public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/4620: Wrong code generated with -O2 for sparc-sun-solaris2.5.1
@ 2001-11-21 16:24 ciceron
  0 siblings, 0 replies; 4+ messages in thread
From: ciceron @ 2001-11-21 16:24 UTC (permalink / raw)
  To: christophe.guillon, gcc-bugs, gcc-gnats, gcc-prs, nobody

Synopsis: Wrong code generated with -O2 for sparc-sun-solaris2.5.1

State-Changed-From-To: open->analyzed
State-Changed-By: ciceron
State-Changed-When: Wed Nov 28 05:37:18 2001
State-Changed-Why:
    confirmed as a bug (3.0.2 and 3.1)

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


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

* Re: optimization/4620: Wrong code generated with -O2 for sparc-sun-solaris2.5.1
@ 2002-04-03  0:41 rth
  0 siblings, 0 replies; 4+ messages in thread
From: rth @ 2002-04-03  0:41 UTC (permalink / raw)
  To: christophe.guillon, gcc-bugs, gcc-prs, nobody

Synopsis: Wrong code generated with -O2 for sparc-sun-solaris2.5.1

State-Changed-From-To: analyzed->closed
State-Changed-By: rth
State-Changed-When: Wed Apr  3 00:41:49 2002
State-Changed-Why:
    Not a bug.
    
      long long lll;
      unsigned *p;
      p = (unsigned *)&lll;
    
    This code violates ISO C aliasing rules (6.5/7).
    With GCC, one can use a union for this, though
    you should note that even that isn't portable.

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


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

* Re: optimization/4620: Wrong code generated with -O2 for sparc-sun-solaris2.5.1
@ 2001-11-21 16:26 ciceron
  0 siblings, 0 replies; 4+ messages in thread
From: ciceron @ 2001-11-21 16:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: ciceron@gcc.gnu.org
To: christophe.guillon@st.com, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org,
  gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: optimization/4620: Wrong code generated with -O2 for sparc-sun-solaris2.5.1
Date: 28 Nov 2001 13:37:19 -0000

 Synopsis: Wrong code generated with -O2 for sparc-sun-solaris2.5.1
 
 State-Changed-From-To: open->analyzed
 State-Changed-By: ciceron
 State-Changed-When: Wed Nov 28 05:37:18 2001
 State-Changed-Why:
     confirmed as a bug (3.0.2 and 3.1)
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4620&database=gcc


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

* optimization/4620: Wrong code generated with -O2 for sparc-sun-solaris2.5.1
@ 2001-10-19  9:36 christophe.guillon
  0 siblings, 0 replies; 4+ messages in thread
From: christophe.guillon @ 2001-10-19  9:36 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4620
>Category:       optimization
>Synopsis:       Wrong code generated with -O2 for sparc-sun-solaris2.5.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 19 09:36:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Christophe Guillon
>Release:        gcc version 3.0  sparc-sun-solaris2.5.1
>Organization:
>Environment:
$ uname -a
SunOS gnx1635 5.5.1 Generic_103640-34 sun4u sparc
$gcc -v
Reading specs from /apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/specs
Configured with: ./configure --prefix=/apa/gnu/SunOS5/.package/gcc-3.0 --x-includes=/usr/openwin/include --x-libraries=/usr/openwin/lib --with-local-prefix=/apa/gnu/SunOS5
Thread model: posix
gcc version 3.0
 /apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/cpp0 -lang-c -v -iprefix /apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/ -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=0 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4 -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -Wall -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc gcc-bug1.c gcc-bug1.i
GNU CPP version 3.0 (cpplib) (sparc)
ignoring nonexistent directory "/apa/gnu/SunOS5/gcc/gcc-3.0/sparc-sun-solaris2.5.1/include"
ignoring nonexistent directory "/apa/gnu/SunOS5/.package/gcc-3.0/sparc-sun-solaris2.5.1/include"
ignoring duplicate directory "/apa/gnu/SunOS5/.package/gcc-3.0/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /apa/gnu/SunOS5/gcc/gcc-3.0/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/include
 /apa/gnu/SunOS5/.package/gcc-3.0/include
 /usr/include
End of search list.
 /apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/cc1 -fpreprocessed gcc-bug1.i -quiet -dumpbase gcc-bug1.c -O2 -Wall -version -o gcc-bug1.s
GNU CPP version 3.0 (cpplib) (sparc)
GNU C version 3.0 (sparc-sun-solaris2.5.1)
        compiled by GNU C version egcs-2.91.60 19981201 (egcs-1.1.1 release).
 /usr/ccs/bin/as -V -Qy -s -o gcc-bug1.o gcc-bug1.s
/usr/ccs/bin/as: WorkShop Compilers 4.2 dev 13 May 1996
 /apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/collect2 -V -Y P,/usr/ccs/lib:/usr/lib -Qy /apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/crt1.o /apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/crti.o /usr/ccs/lib/values-Xa.o /apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/crtbegin.o -L/apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0 -L/apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib -L/apa/gnu/SunOS5/.package/gcc-3.0/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0 -L/usr/ccs/bin -L/usr/ccs/lib -L/apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/../../.. -L/apa/gnu/SunOS5/.package/gcc-3.0/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/../../.. gcc-bug1.o -lgcc -lc -lgcc /apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/crtend.o /apa/gnu/SunOS5/gcc/gcc-3.0/bin/../lib/gcc-lib/sparc-sun-solaris2.5.1/3.0/crtn.o
ld: Software Generation Utilities - Solaris/ELF (3.0)

>Description:
GCC generates wrong assembly code with -O2 option on the
file gcc-bug1.i
with -O1 option the code is correct.

Regarding the assembly output, it seems that the an store is 
scheduled above an overlaping load.

The output should be :
$ ./a.out
Should print 1: 1
It is
$ ./a.out
Should print 1: 0
>How-To-Repeat:
$ /apa/gnu/SunOS5/gcc/gcc-3.0/bin/gcc -Wall -O2 gcc-bug1.i
$ ./a.out
Should print 1: 0
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gcc-bug1.i"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gcc-bug1.i"

IyAyICJnY2MtYnVnMS5jIgpleHRlcm4gaW50IHByaW50Zihjb25zdCBjaGFyICosLi4uKTsKCmxv
bmcgbG9uZyBsbCA9IDE7CmludCBzd2FwOwoKdm9pZApmX2ZhaWwodm9pZCkgewogIGxvbmcgbG9u
ZyBsbGw7CiAgdW5zaWduZWQgKnA7CiAgbGxsID0gbGw7CiAgcCA9ICh1bnNpZ25lZCAqKSZsbGw7
CiAgc3dhcCA9IDE7CiAgcHJpbnRmKCJTaG91bGQgcHJpbnQgMTogJXhcbiIsIHBbc3dhcF0pOwoK
fQoKaW50Cm1haW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkgewogIGZfZmFpbCgpOwogIHJldHVy
biAwOwp9Cg==


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

end of thread, other threads:[~2002-04-03  8:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-21 16:24 optimization/4620: Wrong code generated with -O2 for sparc-sun-solaris2.5.1 ciceron
  -- strict thread matches above, loose matches on Subject: below --
2002-04-03  0:41 rth
2001-11-21 16:26 ciceron
2001-10-19  9:36 christophe.guillon

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