public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Ping: RFA: Testsuite fixes (1/3): builtin_apply
@ 2011-09-25 17:00 Joern Rennecke
  2011-09-25 17:52 ` Richard Guenther
  2011-09-25 18:26 ` Joseph S. Myers
  0 siblings, 2 replies; 3+ messages in thread
From: Joern Rennecke @ 2011-09-25 17:00 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 783 bytes --]

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 -----


[-- Attachment #2: testsuite-patches-20110731-apply --]
[-- Type: text/plain, Size: 1562 bytes --]

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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ping: RFA: Testsuite fixes (1/3): builtin_apply
  2011-09-25 17:00 Ping: RFA: Testsuite fixes (1/3): builtin_apply Joern Rennecke
@ 2011-09-25 17:52 ` Richard Guenther
  2011-09-25 18:26 ` Joseph S. Myers
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Guenther @ 2011-09-25 17:52 UTC (permalink / raw)
  To: Joern Rennecke; +Cc: gcc-patches

On Sun, Sep 25, 2011 at 2:35 PM, Joern Rennecke <amylaar@spamcop.net> wrote:
> 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 -----
>
>
> 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];
> +

How is this ever the correct thing to do?  Why doesn't this trigger
for user code as well?
It really looks like you are papering over backend issues here.

Richard.

>   bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG);
>
>   return 0;
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ping: RFA: Testsuite fixes (1/3): builtin_apply
  2011-09-25 17:00 Ping: RFA: Testsuite fixes (1/3): builtin_apply Joern Rennecke
  2011-09-25 17:52 ` Richard Guenther
@ 2011-09-25 18:26 ` Joseph S. Myers
  1 sibling, 0 replies; 3+ messages in thread
From: Joseph S. Myers @ 2011-09-25 18:26 UTC (permalink / raw)
  To: Joern Rennecke; +Cc: gcc-patches

On Sun, 25 Sep 2011, Joern Rennecke wrote:

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

Shouldn't you fix STACK_ARGUMENTS_SIZE, conditional on the target in use?  
(In gcc.dg/builtin-apply2.c; the other test would need such a definition 
added.)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-25 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-25 17:00 Ping: RFA: Testsuite fixes (1/3): builtin_apply Joern Rennecke
2011-09-25 17:52 ` Richard Guenther
2011-09-25 18:26 ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).