This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/70566] [4.9/5/6 Regression] Bad ARM code generated for evaluating unsigned int bitfield value
- From: "rearnsha at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 07 Apr 2016 09:46:35 +0000
- Subject: [Bug target/70566] [4.9/5/6 Regression] Bad ARM code generated for evaluating unsigned int bitfield value
- Auto-submitted: auto-generated
- References: <bug-70566-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70566
--- Comment #7 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to ktkachov from comment #6)
> Ah, on second glance the peephole looks correct in itself, but the second
> branch following the bmi uses an incorrect condition code.
> So we have:
> tst r3, #2
> bne .L3
> beq .L6
>
> being transformed into:
> ldrb r3, [r0] @ zero_extendqisi2
> lsls r3, r3, #30
> bmi .L3
> beq .L6
>
>
> The beq needs to be updated to be the opposite of bmi. That is, bpl
Sounds like the peephole is missing a reg-dead check on the condition code
value.