public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/4888: incorrect code with -Ox, x >= 2
@ 2001-11-05 2:49 jfran
0 siblings, 0 replies; 3+ messages in thread
From: jfran @ 2001-11-05 2:49 UTC (permalink / raw)
To: gcc-gnats
>Number: 4888
>Category: optimization
>Synopsis: incorrect code with -Ox, x >= 2
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Fri Nov 16 04:06:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: jfran
>Release: gcc >=2.96 <=3.0.2
>Organization:
>Environment:
>Description:
With optimizations enabled, "f=x; y=*(type*)&f;" reads garbage
on 'y' unless 'type'=='char' (problem with memory alias?)
"f=x; g(); y=*(type*)&f;" works fine if g() is not
inlined.
>How-To-Repeat:
Compile with -O0, execute.
Compile with -O2, execute.
Uncomment the commented line.
Test again.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="mem.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="mem.c"
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGcoKTsKCmludCBtYWluKCkgewogIGRvdWJsZSBmOwog
IHVuc2lnbmVkIGludCAqaTsKICBpbnQgeDsKICBmID0gMS4wOwogIGkgPSAodW5zaWduZWQgaW50
ICopJmY7CiAgLy8gZygpOwogIHggPSBpWzFdOwogIHByaW50ZigiJXhcbiIsIHgpOwogIHJldHVy
biAwOwp9Cgp2b2lkIGcoKSB7Cn0K
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: optimization/4888: incorrect code with -Ox, x >= 2
@ 2001-11-21 3:03 rth
0 siblings, 0 replies; 3+ messages in thread
From: rth @ 2001-11-21 3:03 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR optimization/4888; it has been noted by GNATS.
From: rth@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
jfran@clip.dia.fi.upm.es, nobody@gcc.gnu.org
Cc:
Subject: Re: optimization/4888: incorrect code with -Ox, x >= 2
Date: 27 Nov 2001 04:45:43 -0000
Synopsis: incorrect code with -Ox, x >= 2
State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Mon Nov 26 20:45:42 2001
State-Changed-Why:
Not a bug. See ISO/IEC 9899:1999 Section 6.9 paragraph 7.
In summary, you may not access an object with anything other
than its proper type.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4888&database=gcc
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: optimization/4888: incorrect code with -Ox, x >= 2
@ 2001-11-21 2:56 rth
0 siblings, 0 replies; 3+ messages in thread
From: rth @ 2001-11-21 2:56 UTC (permalink / raw)
To: gcc-bugs, gcc-gnats, gcc-prs, jfran, nobody
Synopsis: incorrect code with -Ox, x >= 2
State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Mon Nov 26 20:45:42 2001
State-Changed-Why:
Not a bug. See ISO/IEC 9899:1999 Section 6.9 paragraph 7.
In summary, you may not access an object with anything other
than its proper type.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4888&database=gcc
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-11-27 4:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-05 2:49 optimization/4888: incorrect code with -Ox, x >= 2 jfran
2001-11-21 2:56 rth
2001-11-21 3:03 rth
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).