public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66364] New: poor optimization of packed structs containing bitfields
@ 2015-06-01 15:35 rogero at howzatt dot demon.co.uk
  2020-05-11  5:32 ` [Bug middle-end/66364] " egallager at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rogero at howzatt dot demon.co.uk @ 2015-06-01 15:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66364

            Bug ID: 66364
           Summary: poor optimization of packed structs containing
                    bitfields
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rogero at howzatt dot demon.co.uk
  Target Milestone: ---
            Target: x86_64-redhat-linux

Created attachment 35667
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35667&action=edit
Simple program demonstrating the issue

Code accessing bitfields in packed structures seem to load the value a byte at
a time and build the value up using shifts and ors even with -O3.

On x64 it could load the value using a single mov instruction as it does when
the struct is not packed or when the field is not a bitfield.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-08 22:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-01 15:35 [Bug c++/66364] New: poor optimization of packed structs containing bitfields rogero at howzatt dot demon.co.uk
2020-05-11  5:32 ` [Bug middle-end/66364] " egallager at gcc dot gnu.org
2021-08-11  0:31 ` pinskia at gcc dot gnu.org
2023-02-25  6:44 ` [Bug tree-optimization/66364] " pinskia at gcc dot gnu.org
2023-02-26  1:34 ` pinskia at gcc dot gnu.org
2023-02-26  2:19 ` pinskia at gcc dot gnu.org
2024-03-08 22:12 ` pinskia 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).