Ping: RFA: Testsuite fixes (1/3): builtin_apply

Joern Rennecke amylaar@spamcop.net
Sun Sep 25 17:00:00 GMT 2011


This patch has not been reviewed for eight weeks.

----- Forwarded message from amylaar@spamcop.net -----
     Date: Mon, 01 Aug 2011 00:41:04 -0400
     From: Joern Rennecke <amylaar@spamcop.net>
Reply-To: Joern Rennecke <amylaar@spamcop.net>
  Subject: RFA: Testsuite fixes (1/3): builtin_apply
       To: gcc-patches@gcc.gnu.org

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.


----- End forwarded message -----

-------------- next part --------------
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.

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;


More information about the Gcc-patches mailing list