This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/48803] arm: Bad assembler produced by bit extract/shift
- From: "michael.hope at linaro dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Jul 2011 00:19:56 +0000
- Subject: [Bug target/48803] arm: Bad assembler produced by bit extract/shift
- Auto-submitted: auto-generated
- References: <bug-48803-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48803
Michael Hope <michael.hope at linaro dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |michael.hope at linaro dot
| |org
--- Comment #2 from Michael Hope <michael.hope at linaro dot org> 2011-07-11 00:19:52 UTC ---
Part of the difference is that 4.5 inlines the other functions and 4.6 doesn't.
Adding an __attribute__((always_inline)) to both gives the following:
For 4.5, main is:
main:
movw r3, #22136
movt r3, 4660
and r3, r0, r3
cbnz r3, .L10
mvn r3, #15
lsls r2, r0, r3
ubfx r0, r0, #30, #10
and r3, r0, #768
lsrs r0, r2, #24
orr r0, r3, r0
bx lr
.L10:
ubfx r3, r0, #22, #2
lsrs r0, r0, #24
lsls r3, r3, #8
orr r0, r3, r0
bx lr
For 4.6 it becomes:
main:
movw r3, #22136
movt r3, 4660
ands r3, r3, r0
cbz r3, .L13
ubfx r3, r0, #22, #2
lsrs r0, r0, #24
lsls r3, r3, #8
.L12:
orrs r0, r0, r3
bx lr
.L13:
mov r0, r3
b .L12