This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

optimization/2903: Optimization bug with long long arithmetic



>Number:         2903
>Category:       optimization
>Synopsis:       Optimization bug with long long arithmetic
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 22 11:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Sean McNeil
>Release:        3.1 20010522 (experimental)
>Organization:
>Environment:
Linux 2.4.3 host cross compile to arm-wrs-vxworks
>Description:
The attached code produces incorrect results when compiled at -O2 yet is correct without the -On option.
>How-To-Repeat:
compiled with

arm-wrs-vxworks-gcc -c -O2 bad_result.c 
>Fix:

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

CiNkZWZpbmUgT0ZGU0VUX0lOX1NFQyggYmxvY2ssIG9mZiApIFwKCQkJKCAob2ZmKSAmIChibG9j
ayAtIDEpICkKCmxvbmcgbG9uZyBuZXdQb3MgPSA1MjEwODsKaW50IG5ld0Jsb2NrID0gNTEyOwoK
bG9uZyBsb25nIHBvczsKbG9uZyBsb25nICpwUG9zID0gJnBvczsKCmludCBiYWRfcmVzdWx0ICh2
b2lkKQp7CiAgICBpbnQgcmVzdWx0OwogICAgdW5zaWduZWQgc2hvcnQgYmxvY2s7CgogICAgYmxv
Y2sgPSBuZXdCbG9jazsKICAgICpwUG9zID0gbmV3UG9zOwoKICAgICpwUG9zIC09IE9GRlNFVF9J
Tl9TRUMgKGJsb2NrLCAqcFBvcyk7CgogICAgcHJpbnRmICgiJWRcbiIsIChpbnQpKnBQb3MpOwoK
ICAgIHJlc3VsdCA9ICgqcFBvcyA8IGJsb2NrKTsKCiAgICByZXR1cm4gcmVzdWx0Owp9Cg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]