public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/10312: optimizer creates wrong code for loop
@ 2003-04-04 22:06 Eric Botcazou
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Botcazou @ 2003-04-04 22:06 UTC (permalink / raw)
  To: rakdver; +Cc: gcc-prs

The following reply was made to PR optimization/10312; it has been noted by GNATS.

From: Eric Botcazou <ebotcazou@libertysurf.fr>
To: Peter van Hoof <p.van-hoof@qub.ac.uk>
Cc: gcc-bugs@gcc.gnu.org,
 nobody@gcc.gnu.org,
 gcc-gnats@gcc.gnu.org
Subject: Re: optimization/10312: optimizer creates wrong code for loop
Date: Sat, 5 Apr 2003 00:00:04 +0200

 > >     Does passing -fno-gcse-sm cure the problem?
 >
 > Yes, that cures the problem.
 
 Ok. The regression was detected this morning on Sparc through the failure of
 
 FAIL: gcc.dg/20030324-1.c execution test
 
 See http://gcc.gnu.org/ml/gcc-patches/2003-04/msg00254.html
 
 I'm going to assign the PR to Zdenek.
 
 Thanks for the quick feedback.
 
 -- 
 Eric Botcazou


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

* Re: optimization/10312: optimizer creates wrong code for loop
@ 2003-04-04 19:16 Peter van Hoof
  0 siblings, 0 replies; 4+ messages in thread
From: Peter van Hoof @ 2003-04-04 19:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/10312; it has been noted by GNATS.

From: Peter van Hoof <p.van-hoof@qub.ac.uk>
To: ebotcazou@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, 
    p.van-hoof@qub.ac.uk, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: optimization/10312: optimizer creates wrong code for loop
Date: Fri, 04 Apr 2003 20:08:39 +0100

 >     Does passing -fno-gcse-sm cure the problem?
 
 Yes, that cures the problem.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10312
 
 
 -- 
 Peter van Hoof
 APS Division - Physics Department
 Queen's University of Belfast
 Belfast BT7 1NN
 Northern Ireland
 Home Page: http://star.pst.qub.ac.uk/~pvh
 


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

* Re: optimization/10312: optimizer creates wrong code for loop
@ 2003-04-04 19:03 ebotcazou
  0 siblings, 0 replies; 4+ messages in thread
From: ebotcazou @ 2003-04-04 19:03 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, p.van-hoof

Synopsis: optimizer creates wrong code for loop

State-Changed-From-To: open->feedback
State-Changed-By: ebotcazou
State-Changed-When: Fri Apr  4 19:03:28 2003
State-Changed-Why:
    Does passing -fno-gcse-sm cure the problem?

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10312


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

* optimization/10312: optimizer creates wrong code for loop
@ 2003-04-04 18:56 p.van-hoof
  0 siblings, 0 replies; 4+ messages in thread
From: p.van-hoof @ 2003-04-04 18:56 UTC (permalink / raw)
  To: gcc-gnats; +Cc: p.van-hoof


>Number:         10312
>Category:       optimization
>Synopsis:       optimizer creates wrong code for loop
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 04 18:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Peter van Hoof
>Release:        3.4 20030403 (experimental)
>Organization:
Queen's University of Belfast
>Environment:
System: SunOS scooby 5.9 Generic_112233-04 sun4u sparc SUNW,Sun-Blade-100
Architecture: sun4

	
host: sparc-sun-solaris2.9
build: sparc-sun-solaris2.9
target: sparc-sun-solaris2.9
configured with: /scratch/gcc-repository/cvs/gcc/configure --prefix=/opt/local/gcc340 --enable-languages=c,c++,f77 --with-gnu-as --with-as=/opt/local/bin/gas
>Description:
The optimizer creates wrong code for the loop in the attached program.
When compiled with -O2, the resulting code will generate a segfault.
If the "double a" member of the struct is removed, the program will get
stuck in an infinite loop, rather than crash.

The program behaves correctly with gcc 3.2.2 and 3.3, so this is a regression.
>How-To-Repeat:
scooby> gcc -v -O2 c.c
Reading specs from /opt/local/gcc340/lib/gcc-lib/sparc-sun-solaris2.9/3.4/specs
Configured with: /scratch/gcc-repository/cvs/gcc/configure --prefix=/opt/local/gcc340 --enable-languages=c,c++,f77 --with-gnu-as --with-as=/opt/local/bin/gas
Thread model: posix
gcc version 3.4 20030403 (experimental)
 /opt/local/gcc340/lib/gcc-lib/sparc-sun-solaris2.9/3.4/cc1 -quiet -v -Dsparc -D__sparc__ -D__sparc -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc c.c -quiet -dumpbase c.c -auxbase c -O2 -version -o /var/tmp//ccXLgTFq.s
ignoring nonexistent directory "/opt/local/gcc340/sparc-sun-solaris2.9/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /opt/local/gcc340/include
 /opt/local/gcc340/lib/gcc-lib/sparc-sun-solaris2.9/3.4/include
 /usr/include
End of search list.
GNU C version 3.4 20030403 (experimental) (sparc-sun-solaris2.9)
	compiled by GNU C version 3.4 20030403 (experimental).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 /opt/local/bin/gas -V -Qy -s -o /var/tmp//ccOfg7jT.o /var/tmp//ccXLgTFq.s
GNU assembler version 2.13.2.1 (sparc-sun-solaris2.9) using BFD version 2.13.2.1
 /opt/local/gcc340/lib/gcc-lib/sparc-sun-solaris2.9/3.4/collect2 -V -Y P,/usr/ccs/lib:/usr/lib -Qy /opt/local/gcc340/lib/gcc-lib/sparc-sun-solaris2.9/3.4/crt1.o /opt/local/gcc340/lib/gcc-lib/sparc-sun-solaris2.9/3.4/crti.o /usr/ccs/lib/values-Xa.o /opt/local/gcc340/lib/gcc-lib/sparc-sun-solaris2.9/3.4/crtbegin.o -L/opt/local/gcc340/lib/gcc-lib/sparc-sun-solaris2.9/3.4 -L/usr/ccs/bin -L/usr/ccs/lib -L/opt/local/gcc340/lib/gcc-lib/sparc-sun-solaris2.9/3.4/../../.. /var/tmp//ccOfg7jT.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc /opt/local/gcc340/lib/gcc-lib/sparc-sun-solaris2.9/3.4/crtend.o /opt/local/gcc340/lib/gcc-lib/sparc-sun-solaris2.9/3.4/crtn.o
ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.373

scooby>	a.out 
Segmentation fault

scooby>	cat c.c
struct {
	double a; 
	int n[2];
} g = { 0., { 1, 2 } };

int k = 0;

void b(int *j) {}

int main()
{
	int j;
	for( j=0; j < 2; j++ )
		k = ( k > g.n[j] ) ? k : g.n[j];
	k++;
	b(&j);
	return 0;
}
>Fix:
Workaround: use lower level of optimization.
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-04-04 22:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-04 22:06 optimization/10312: optimizer creates wrong code for loop Eric Botcazou
  -- strict thread matches above, loose matches on Subject: below --
2003-04-04 19:16 Peter van Hoof
2003-04-04 19:03 ebotcazou
2003-04-04 18:56 p.van-hoof

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