Bug 11863

Summary: Regression: Optimizer produces incorrect code for ARM target
Product: gcc Reporter: Pete Gonzalez <pgonzalez>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: gcc-bugs
Priority: P2    
Version: 3.3   
Target Milestone: 3.4.0   
Host: i686-pc-cygwin Target: arm-arm-elf
Build: i686-pc-cygwin Known to work:
Known to fail: Last reconfirmed:
Attachments: Test.cpp

Description Pete Gonzalez 2003-08-09 05:47:27 UTC
The attached file compiles correctly with GCC versions 3.0.4 and 3.2.3; 
however, incorrect output is produced with GCC 3.3 and the mainline 
snapshot "gcc-3.4-20030730".

The problem goes away when optimizations are disabled.  This problem does not 
occur on other targets, e.g. i686.
Comment 1 Pete Gonzalez 2003-08-09 05:49:21 UTC
Created attachment 4584 [details]
Test.cpp

Compile with this command: "gcc -c -O2 Test.cpp -marm -save-temps"

The output file Test.s should contain three "smull" instructions and six
"smlal" instructions.  However, with GCC 3.3 and later the generated code is
incorrect, e.g. there is only one "smull" instruction and two "smlal"
instructions.
Comment 2 Falk Hueffner 2003-08-09 10:51:06 UTC
Your code contains lots of aliasing violations, which are the cause for your
problems. I suggest you fix them or use -fno-strict-aliasing.
Comment 3 Andrew Pinski 2005-06-05 08:28:00 UTC
Reopening to ...
Comment 4 Andrew Pinski 2005-06-05 08:28:15 UTC
Mark as a dup of bug 21920.

*** This bug has been marked as a duplicate of 21920 ***