optimization/8278: gcc3.2 -O3 generates wrong code
tenthumbs@cybernex.net
tenthumbs@cybernex.net
Fri Oct 18 12:36:00 GMT 2002
>Number: 8278
>Category: optimization
>Synopsis: gcc3.2 -O3 generates wrong code
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Fri Oct 18 12:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: tenthumbs@cybernex.net
>Release: unknown-1.0
>Organization:
>Environment:
Linux x86
>Description:
Compile the attached code with -O2 and then with -O3 and
note the different output. It appears the gcc pushes the
printf arguments in the wrong order.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="q.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="q.c"
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgZnJvYiAoaW50IHgpCnsKCXJlZ2lzdGVyIGludCByOwoK
CWFzbSB2b2xhdGlsZSAoCgkJInNocmwgJDMxLCAlJWVheFxuXHQiCgkJOiAiPXIiIChyKQoJCTog
IjAiICh4KQoJKTsKCXJldHVybiByOwp9CgpzdGF0aWMgY29uc3QgaW50IGludHNbXSA9IHsxLC0x
LDEyMzQ1LC0xMjM0NSwgMCwgMHg4MDAwMDAwMCwgMHg3ZmZmZmZmZn07CnN0YXRpYyBjb25zdCBp
bnQgbmludHMgPSBzaXplb2YoaW50cykvc2l6ZW9mKGludHNbMF0pOwoKaW50IG1haW4gKHZvaWQp
CnsKCWludCBpOwoKCWZvciAoaSA9IDA7IGkgPCBuaW50czsgKytpKQoJewoJCXByaW50ZiAoIiVk
IC0+ICVkXG4iLCBpbnRzW2ldLCBmcm9iKGludHNbaV0pKTsKCX0KCXJldHVybiAwOwp9Cg==
More information about the Gcc-bugs
mailing list