This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/48090] gcc 4.5.2 miscompilation when building on arm
- From: "mikpe at it dot uu.se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 13 Mar 2011 15:09:51 +0000
- Subject: [Bug c/48090] gcc 4.5.2 miscompilation when building on arm
- Auto-submitted: auto-generated
- References: <bug-48090-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48090
Mikael Pettersson <mikpe at it dot uu.se> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rearnsha at gcc dot gnu.org
--- Comment #7 from Mikael Pettersson <mikpe at it dot uu.se> 2011-03-13 15:09:36 UTC ---
The miscompilation on 4.5 branch started with r154181, the PR42031 fix; see
<http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00725.html>.
On the standalone test case, r154181 changed the -march=armv5t -O2 code as
follows:
--- pr48090.s-r154180 2011-03-13 15:39:16.000000000 +0100
+++ pr48090.s-r154181 2011-03-13 15:43:21.000000000 +0100
@@ -81,11 +81,9 @@
mov r6, r1
bl seek_archive
cmp r1, #0
- mov r3, r0
- mov r4, r1
blt .L14
- rsbs r1, r3, #0
- rsc r2, r4, #0
+ rsbs r1, r0, #0
+ rsc r2, r1, #0
mov r4, r2, asl #9
mov r3, r1, asl #9
orr r4, r4, r1, lsr #23
which breaks the second 'rsc' insn since it now reads the updated r1 value
instead of the original one.