diff mbox

RFA: Testsuite fixes (1/3): builtin_apply

Message ID 20110801004104.b0hudtn6io40wcgg-nzlynne@webmail.spamcop.net
State New
Headers show

Commit Message

Joern Rennecke Aug. 1, 2011, 4:41 a.m. UTC
I am working with a toolchain that is frugal with stack usage at startup, so
an attempt to read dozens more bytes than have been pushed causes unmapped
memory references.

Fixed by adding an automatic variable that occupies sufficient space.

Regression tested with x86_64-unknown-linux-gnu X sh-elf .
No change there, as the default SH liker script places the stack at 3M,
and the default simulator size is 16M.
2011-07-21  Joern Rennecke <joern.rennecke@embecosm.com>

	* gcc.dg/torture/stackalign/builtin-apply2.c:
	Make sure we don't read past the bottom of the stack.

2009-09-24  Joern Rennecke <joern.rennecke@embecosm.com>

	* gcc.dg/builtin-apply2.c: Make sure we don't read past the bottom of
	the stack.
diff mbox

Patch

Index: gcc.dg/torture/stackalign/builtin-apply-2.c
===================================================================
--- gcc.dg/torture/stackalign/builtin-apply-2.c	(.../GNU/fsf-gcc/trunk/gcc/testsuite)	(revision 2013)
+++ gcc.dg/torture/stackalign/builtin-apply-2.c	(.../Customer-Projects/X/branches/Y-20110628/toolchain/gcc-4.7.0-20110701/gcc/testsuite)	(revision 2013)
@@ -24,7 +24,10 @@  void bar(char *name, ...)
 
 int main(void)
 {
-  bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG);
+  /* Make sure that there is some stack that can be legitimately read.  */
+  char dummy[64];
+
+  bar(dummy, 5.444567, 8.90765, 4.567789, INTEGER_ARG);
 
   return 0;
 }
Index: gcc.dg/builtin-apply2.c
===================================================================
--- gcc.dg/builtin-apply2.c	(.../GNU/fsf-gcc/trunk/gcc/testsuite)	(revision 2013)
+++ gcc.dg/builtin-apply2.c	(.../Customer-Projects/X/branches/Y-20110628/toolchain/gcc-4.7.0-20110701/gcc/testsuite)	(revision 2013)
@@ -36,6 +36,9 @@  void bar(char *name, ...)
 
 int main(void)
 {
+  /* Make sure that there is some stack that can be legitimately read.  */
+  char dummy[64];
+
   bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG);
 
   return 0;