public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Is gcc.c-torture/execute/20020307-2.c supposed to pass on gcc 3.1?
@ 2002-07-22  4:13 H. J. Lu
  2002-07-22 14:21 ` H. J. Lu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: H. J. Lu @ 2002-07-22  4:13 UTC (permalink / raw)
  To: gcc

On Linux/x86, I got

# ./xgcc -B../ ~/work/gnu/import/gcc-3.1/gcc/testsuite/gcc.c-torture/execute/20020307-2.c -O -mcpu=i686 -march=i386
# ./a.out
zsh: 32558 segmentation fault  ./a.out



H.J.

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

* Re: Is gcc.c-torture/execute/20020307-2.c supposed to pass on gcc 3.1?
  2002-07-22  4:13 Is gcc.c-torture/execute/20020307-2.c supposed to pass on gcc 3.1? H. J. Lu
@ 2002-07-22 14:21 ` H. J. Lu
  2002-07-23 23:17 ` Richard Henderson
  2002-07-26  8:54 ` H. J. Lu
  2 siblings, 0 replies; 6+ messages in thread
From: H. J. Lu @ 2002-07-22 14:21 UTC (permalink / raw)
  To: gcc; +Cc: jh

On Sun, Jul 21, 2002 at 10:56:32PM -0700, H. J. Lu wrote:
> On Linux/x86, I got
> 
> # ./xgcc -B../ ~/work/gnu/import/gcc-3.1/gcc/testsuite/gcc.c-torture/execute/20020307-2.c -O -mcpu=i686 -march=i386
> # ./a.out
> zsh: 32558 segmentation fault  ./a.out
> 

The problem seems to be x86_accumulate_outgoing_args. When it is
enabled, gcc generates code like

        call    memcpy
        call    foo

As the result, some bogus value is passed to foo. 


H.J.

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

* Re: Is gcc.c-torture/execute/20020307-2.c supposed to pass on gcc 3.1?
  2002-07-22  4:13 Is gcc.c-torture/execute/20020307-2.c supposed to pass on gcc 3.1? H. J. Lu
  2002-07-22 14:21 ` H. J. Lu
@ 2002-07-23 23:17 ` Richard Henderson
  2002-07-26  8:54 ` H. J. Lu
  2 siblings, 0 replies; 6+ messages in thread
From: Richard Henderson @ 2002-07-23 23:17 UTC (permalink / raw)
  To: H. J. Lu; +Cc: gcc

On Sun, Jul 21, 2002 at 10:56:32PM -0700, H. J. Lu wrote:
> # ./xgcc -B../ ~/work/gnu/import/gcc-3.1/gcc/testsuite/gcc.c-torture/execute/20020307-2.c -O -mcpu=i686 -march=i386

This is a known failure.

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

* Re: Is gcc.c-torture/execute/20020307-2.c supposed to pass on gcc 3.1?
  2002-07-22  4:13 Is gcc.c-torture/execute/20020307-2.c supposed to pass on gcc 3.1? H. J. Lu
  2002-07-22 14:21 ` H. J. Lu
  2002-07-23 23:17 ` Richard Henderson
@ 2002-07-26  8:54 ` H. J. Lu
  2002-07-28  1:51   ` Richard Henderson
  2 siblings, 1 reply; 6+ messages in thread
From: H. J. Lu @ 2002-07-26  8:54 UTC (permalink / raw)
  To: gcc

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

On Sun, Jul 21, 2002 at 10:56:32PM -0700, H. J. Lu wrote:
> On Linux/x86, I got
> 
> # ./xgcc -B../ ~/work/gnu/import/gcc-3.1/gcc/testsuite/gcc.c-torture/execute/20020307-2.c -O -mcpu=i686 -march=i386
> # ./a.out
> zsh: 32558 segmentation fault  ./a.out
> 
> 

Since it is a known bug, will the patch enclosed here cause any harm?


H.J.

[-- Attachment #2: gcc-var.patch --]
[-- Type: text/plain, Size: 469 bytes --]

2002-07-25  H.J. Lu <hjl@gnu.org>

	* calls.c (PUSH_ARGS_REVERSED): 1 if ACCUMULATE_OUTGOING_ARGS
	is 1.

--- gcc/calls.c.var	Fri Apr  5 23:25:04 2002
+++ gcc/calls.c	Thu Jul 25 19:21:42 2002
@@ -47,7 +47,7 @@ Software Foundation, 59 Temple Place - S
 #ifdef PUSH_ROUNDING
 
 #if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD)
-#define PUSH_ARGS_REVERSED  PUSH_ARGS
+#define PUSH_ARGS_REVERSED  (PUSH_ARGS || ACCUMULATE_OUTGOING_ARGS)
 #endif
 
 #endif

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

* Re: Is gcc.c-torture/execute/20020307-2.c supposed to pass on gcc 3.1?
  2002-07-26  8:54 ` H. J. Lu
@ 2002-07-28  1:51   ` Richard Henderson
  2002-07-28 21:27     ` H. J. Lu
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 2002-07-28  1:51 UTC (permalink / raw)
  To: H. J. Lu; +Cc: gcc

On Thu, Jul 25, 2002 at 07:37:26PM -0700, H. J. Lu wrote:
> 	* calls.c (PUSH_ARGS_REVERSED): 1 if ACCUMULATE_OUTGOING_ARGS is 1.

What the hell are you trying to accomplish here?  The
x86 bug appears when ACCUMULATE_OUTGOING_ARGS is false.


r~

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

* Re: Is gcc.c-torture/execute/20020307-2.c supposed to pass on gcc 3.1?
  2002-07-28  1:51   ` Richard Henderson
@ 2002-07-28 21:27     ` H. J. Lu
  0 siblings, 0 replies; 6+ messages in thread
From: H. J. Lu @ 2002-07-28 21:27 UTC (permalink / raw)
  To: Richard Henderson, gcc

On Sat, Jul 27, 2002 at 03:04:26PM -0700, Richard Henderson wrote:
> On Thu, Jul 25, 2002 at 07:37:26PM -0700, H. J. Lu wrote:
> > 	* calls.c (PUSH_ARGS_REVERSED): 1 if ACCUMULATE_OUTGOING_ARGS is 1.
> 
> What the hell are you trying to accomplish here?  The
> x86 bug appears when ACCUMULATE_OUTGOING_ARGS is false.
> 

# /usr/gcc-3.1/bin/gcc  -O -march=i386 -mcpu=i386 20020307-2.c -maccumulate-outgoing-args
# ./a.out
zsh: 29175 segmentation fault  ./a.out
# /usr/gcc-3.1/bin/gcc  -O -march=i386 -mcpu=i386 20020307-2.c
# ./a.out
#

Did I miss something? BTW, I have posted an updated patch:

http://gcc.gnu.org/ml/gcc-patches/2002-07/msg01561.html


H.J.


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

end of thread, other threads:[~2002-07-28  1:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-22  4:13 Is gcc.c-torture/execute/20020307-2.c supposed to pass on gcc 3.1? H. J. Lu
2002-07-22 14:21 ` H. J. Lu
2002-07-23 23:17 ` Richard Henderson
2002-07-26  8:54 ` H. J. Lu
2002-07-28  1:51   ` Richard Henderson
2002-07-28 21:27     ` H. J. Lu

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