This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
optimization/1096: bug when using -O2 option
- To: gcc-gnats at gcc dot gnu dot org
- Subject: optimization/1096: bug when using -O2 option
- From: lennychen at yahoo dot com
- Date: 19 Dec 2000 20:29:30 -0000
- Reply-To: lennychen at yahoo dot com
>Number: 1096
>Category: optimization
>Synopsis: bug when using -O2 option
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Dec 19 12:36:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Lenny Chen
>Release: gcc version 2.95.2 19991024
>Organization:
>Environment:
SunOS canyon 5.6 Generic_105181-23 sun4u sparc SUNW,Ultra-60
>Description:
gcc -O2 generates incorrect executable code.
>How-To-Repeat:
gcc -O2 -o test test.c
./test
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.c"
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgdGVzdChpbnQgZGopOwoKbWFpbigpCnsKICBpbnQgc2Fk
OwoKICBzYWQgPSB0ZXN0KDgpOwoKICBmcHJpbnRmKHN0ZGVyciwgInNhZD0lZFxuIiwgc2FkKTsK
fQoKaW50IHRlc3QoaW50IGRqKQp7CiAgaW50IHNhZCxqOwoKICBzYWQgPSAwOwogIGZvciAoaiA9
IDA7IGogPCAxNjsgaiArPSBkaikgewogICAgc2FkICs9IDE7CiAgfQoKICBmcHJpbnRmKHN0ZGVy
ciwgImo9JWQsc2FkPSVkXG4iLCBqLHNhZCk7CgogIHJldHVybihzYWQpOwp9Cg==