public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/42172] inefficient bit fields assignments
[not found] <bug-42172-4@http.gcc.gnu.org/bugzilla/>
@ 2011-03-25 20:07 ` jakub at gcc dot gnu.org
2011-04-28 16:52 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-25 20:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42172
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.6.0 |4.6.1
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-25 19:53:14 UTC ---
GCC 4.6.0 is being released, adjusting target milestone.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/42172] inefficient bit fields assignments
[not found] <bug-42172-4@http.gcc.gnu.org/bugzilla/>
2011-03-25 20:07 ` [Bug tree-optimization/42172] inefficient bit fields assignments jakub at gcc dot gnu.org
@ 2011-04-28 16:52 ` rguenth at gcc dot gnu.org
2013-01-17 0:26 ` janis at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-28 16:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42172
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.6.1 |---
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/42172] inefficient bit fields assignments
[not found] <bug-42172-4@http.gcc.gnu.org/bugzilla/>
2011-03-25 20:07 ` [Bug tree-optimization/42172] inefficient bit fields assignments jakub at gcc dot gnu.org
2011-04-28 16:52 ` rguenth at gcc dot gnu.org
@ 2013-01-17 0:26 ` janis at gcc dot gnu.org
2015-04-09 3:47 ` amker at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: janis at gcc dot gnu.org @ 2013-01-17 0:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42172
Janis Johnson <janis at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |janis at gcc dot gnu.org
--- Comment #8 from Janis Johnson <janis at gcc dot gnu.org> 2013-01-17 00:26:10 UTC ---
The test gcc.target/arm/pr42172-1.c currently passes for armv6t2, armv7*, and
armv8* with and without -mthumb. At this point can the test be limited to
those processors, or XFAILed for others?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/42172] inefficient bit fields assignments
[not found] <bug-42172-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2013-01-17 0:26 ` janis at gcc dot gnu.org
@ 2015-04-09 3:47 ` amker at gcc dot gnu.org
2015-04-09 13:57 ` segher at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: amker at gcc dot gnu.org @ 2015-04-09 3:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42172
amker at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amker at gcc dot gnu.org
--- Comment #9 from amker at gcc dot gnu.org ---
Created attachment 35265
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35265&action=edit
rtl dump for both cortex-m0 and cortex-m3
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/42172] inefficient bit fields assignments
[not found] <bug-42172-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2015-04-09 3:47 ` amker at gcc dot gnu.org
@ 2015-04-09 13:57 ` segher at gcc dot gnu.org
2021-07-21 3:11 ` pinskia at gcc dot gnu.org
2021-07-21 3:18 ` pinskia at gcc dot gnu.org
6 siblings, 0 replies; 11+ messages in thread
From: segher at gcc dot gnu.org @ 2015-04-09 13:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42172
Segher Boessenkool <segher at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |segher at gcc dot gnu.org
--- Comment #11 from Segher Boessenkool <segher at gcc dot gnu.org> ---
I have code to improve zero_extract (and similar) handling in
combine. For stage1, obviously.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/42172] inefficient bit fields assignments
[not found] <bug-42172-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2015-04-09 13:57 ` segher at gcc dot gnu.org
@ 2021-07-21 3:11 ` pinskia at gcc dot gnu.org
2021-07-21 3:18 ` pinskia at gcc dot gnu.org
6 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-21 3:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42172
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Severity|normal |enhancement
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/42172] inefficient bit fields assignments
[not found] <bug-42172-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2021-07-21 3:11 ` pinskia at gcc dot gnu.org
@ 2021-07-21 3:18 ` pinskia at gcc dot gnu.org
6 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-21 3:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42172
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Target Milestone|--- |7.0
Status|NEW |RESOLVED
--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed already fully in GCC 7, there are already testcases committed for this.
Most likely r7-4171 .
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/42172] New: inefficient bit fields assignments
@ 2009-11-25 9:16 carrot at google dot com
2010-08-09 15:04 ` [Bug tree-optimization/42172] " bernds at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: carrot at google dot com @ 2009-11-25 9:16 UTC (permalink / raw)
To: gcc-bugs
The attached test case contains several continuous bit fields assignment,
compile it with options -mthumb -Os, gcc generates
.fnstart
.LFB1:
ldrb r3, [r0]
mov r2, #7
bic r3, r3, r2
strb r3, [r0]
ldrb r3, [r0]
mov r2, #56
bic r3, r3, r2
mov r2, #8
orr r3, r3, r2
strb r3, [r0]
ldrb r3, [r0]
mov r2, #64
bic r3, r3, r2
strb r3, [r0]
ldrb r2, [r0]
mov r3, #127
and r3, r3, r2
strb r3, [r0]
@ sp needed for prologue
bx lr
The 4 fields are contained in one word, for each field assignment the code
loads the word, changes the field, then write the word back. A better code
sequence should load the word once, change all 4 fields, then write back the
changed word.
ldrb r3, [r0]
mov r2, #255 // bit mask
bic r3, r3, r2
mov r2, #8 // the new value of all 4 fields
orr r3, r3, r2
strb r3, [r0]
@ sp needed for prologue
bx lr
or more aggressively if the word contains only these four fields
mov r3, #8
strb r3, [r0]
@ sp needed for prologue
bx lr
--
Summary: inefficient bit fields assignments
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: carrot at google dot com
GCC build triplet: i686-linux
GCC host triplet: i686-linux
GCC target triplet: arm-eabi
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42172
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-07-21 3:18 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-42172-4@http.gcc.gnu.org/bugzilla/>
2011-03-25 20:07 ` [Bug tree-optimization/42172] inefficient bit fields assignments jakub at gcc dot gnu.org
2011-04-28 16:52 ` rguenth at gcc dot gnu.org
2013-01-17 0:26 ` janis at gcc dot gnu.org
2015-04-09 3:47 ` amker at gcc dot gnu.org
2015-04-09 13:57 ` segher at gcc dot gnu.org
2021-07-21 3:11 ` pinskia at gcc dot gnu.org
2021-07-21 3:18 ` pinskia at gcc dot gnu.org
2009-11-25 9:16 [Bug target/42172] New: " carrot at google dot com
2010-08-09 15:04 ` [Bug tree-optimization/42172] " bernds at gcc dot gnu dot org
2010-08-19 17:32 ` bernds at gcc dot gnu dot org
2010-09-01 9:07 ` ramana at gcc dot gnu dot org
2010-09-01 9:07 ` ramana at gcc dot gnu dot 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).