This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66364] New: poor optimization of packed structs containing bitfields
- From: "rogero at howzatt dot demon.co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 01 Jun 2015 15:34:57 +0000
- Subject: [Bug c++/66364] New: poor optimization of packed structs containing bitfields
- Auto-submitted: auto-generated
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.