[PATCH] Use ATTRIBUTE_PACKED in ree.c
Jakub Jelinek
jakub@redhat.com
Wed Nov 21 20:42:00 GMT 2012
Hi!
The PR55430 miscompilation of ree.c by LRA lead me to look at
this structure, which was really meant to be just 2 byte long, but
is unnecessarily 4 byte long. As it only contains 8, 2 and 1 bit bitfields,
it can always (except old alphas) be accessed by 1 byte loads/stores, so
packed attribute doesn't slow things down. Fixed thusly, bootstrapped/regtested on
x86_64-linux and i686-linux, ok for trunk?
2012-11-21 Jakub Jelinek <jakub@redhat.com>
* ree.c (struct ext_modified): Add ATTRIBUTE_PACKED.
--- gcc/ree.c.jj 2012-11-21 16:00:13.000000000 +0100
+++ gcc/ree.c 2012-11-21 18:43:27.025706082 +0100
@@ -475,7 +475,7 @@ enum ext_modified_kind
EXT_MODIFIED_SEXT
};
-struct ext_modified
+struct ATTRIBUTE_PACKED ext_modified
{
/* Mode from which ree has zero or sign extended the destination. */
ENUM_BITFIELD(machine_mode) mode : 8;
Jakub
More information about the Gcc-patches
mailing list