public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/48803] New: arm: Bad assembler produced by bit extract/shift
@ 2011-04-28 11:34 david.gilbert at linaro dot org
2011-05-06 13:19 ` [Bug target/48803] " ramana at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: david.gilbert at linaro dot org @ 2011-04-28 11:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48803
Summary: arm: Bad assembler produced by bit extract/shift
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: david.gilbert@linaro.org
Created attachment 24123
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24123
Produces bad assembler
This was originally reported as Linaro-gcc bug in Launchpad here:
https://bugs.launchpad.net/gcc-linaro/+bug/771903
The attached small test case fails with the assembler error:
gcc -O3 arm_bit_extract.c
/tmp/ccOOK26S.s: Assembler messages:
/tmp/ccOOK26S.s:97: Error: bit-field extends past end of register -- `ubfx
r0,r0,#30,#10'
when compiled -O3 for ARMv7 on Ubuntu's gcc 4.5.2-8ubuntu1.
I'm told it also fails on vanilla 4.5.2
The shift that the source is trying to do is a bit bogus, however it shouldn't
produce bad assembler.
Dave
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/48803] arm: Bad assembler produced by bit extract/shift
2011-04-28 11:34 [Bug target/48803] New: arm: Bad assembler produced by bit extract/shift david.gilbert at linaro dot org
@ 2011-05-06 13:19 ` ramana at gcc dot gnu.org
2011-07-11 0:20 ` michael.hope at linaro dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: ramana at gcc dot gnu.org @ 2011-05-06 13:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48803
Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.05.06 13:10:47
CC| |ramana at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> 2011-05-06 13:10:47 UTC ---
Occurs on gcc 4.5 branch but not on 4.6 branch or trunk. Need to see where and
why it got "fixed" .
Ramana
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/48803] arm: Bad assembler produced by bit extract/shift
2011-04-28 11:34 [Bug target/48803] New: arm: Bad assembler produced by bit extract/shift david.gilbert at linaro dot org
2011-05-06 13:19 ` [Bug target/48803] " ramana at gcc dot gnu.org
@ 2011-07-11 0:20 ` michael.hope at linaro dot org
2011-09-22 19:31 ` mikpe at it dot uu.se
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: michael.hope at linaro dot org @ 2011-07-11 0:20 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/48803] arm: Bad assembler produced by bit extract/shift
2011-04-28 11:34 [Bug target/48803] New: arm: Bad assembler produced by bit extract/shift david.gilbert at linaro dot org
2011-05-06 13:19 ` [Bug target/48803] " ramana at gcc dot gnu.org
2011-07-11 0:20 ` michael.hope at linaro dot org
@ 2011-09-22 19:31 ` mikpe at it dot uu.se
2012-07-31 0:57 ` ramana at gcc dot gnu.org
2015-06-24 23:28 ` ramana at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: mikpe at it dot uu.se @ 2011-09-22 19:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48803
Mikael Pettersson <mikpe at it dot uu.se> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mikpe at it dot uu.se
--- Comment #3 from Mikael Pettersson <mikpe at it dot uu.se> 2011-09-22 19:29:38 UTC ---
This test case stopped failing, sort of, for 4.6 by r162943, the introduction
of tree-bit-ccp optimization. However that revision merely masked the problem
by default, as compiling with 4.6.[01] and -fno-tree-bit-ccp makes it reappear.
The bug was finally fixed for 4.7 by r176911, the fix for the similar PR49799.
That fix was also applied for 4.6.2 in r176917.
Backporting r176917 to 4.5 and 4.4 fixes both PRs there too.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/48803] arm: Bad assembler produced by bit extract/shift
2011-04-28 11:34 [Bug target/48803] New: arm: Bad assembler produced by bit extract/shift david.gilbert at linaro dot org
` (2 preceding siblings ...)
2011-09-22 19:31 ` mikpe at it dot uu.se
@ 2012-07-31 0:57 ` ramana at gcc dot gnu.org
2015-06-24 23:28 ` ramana at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: ramana at gcc dot gnu.org @ 2012-07-31 0:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48803
Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.6.2, 4.7.0
Known to fail| |4.5.2
--- Comment #4 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> 2012-07-31 00:57:03 UTC ---
This is a 4.5 only bug and should probably be closed as 4.5 is now kind of
dead.
Ramana
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug target/48803] arm: Bad assembler produced by bit extract/shift
2011-04-28 11:34 [Bug target/48803] New: arm: Bad assembler produced by bit extract/shift david.gilbert at linaro dot org
` (3 preceding siblings ...)
2012-07-31 0:57 ` ramana at gcc dot gnu.org
@ 2015-06-24 23:28 ` ramana at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: ramana at gcc dot gnu.org @ 2015-06-24 23:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48803
Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #5 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
Duplicate then of PR49799... About time we closed this.
*** This bug has been marked as a duplicate of bug 49799 ***
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-06-24 23:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-28 11:34 [Bug target/48803] New: arm: Bad assembler produced by bit extract/shift david.gilbert at linaro dot org
2011-05-06 13:19 ` [Bug target/48803] " ramana at gcc dot gnu.org
2011-07-11 0:20 ` michael.hope at linaro dot org
2011-09-22 19:31 ` mikpe at it dot uu.se
2012-07-31 0:57 ` ramana at gcc dot gnu.org
2015-06-24 23:28 ` ramana at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).