This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/56997] Incorrect write to packed field when strict-volatile-bitfields enabled on aarch32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56997

--- Comment #7 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
aehmm sorry, the object "g" from above code is actually from PR#48784

#pragma pack(1)
volatile struct S0 {
   signed a : 7;
   unsigned b : 28;
} g = {0,-1};

=> sizeof(g) = 5

but the code from this example has pretty much the same problems:

typedef struct s{
 unsigned char Prefix;
 test_type Type;
}__attribute((__packed__)) ss;

=> sizeof(ss) = 5

foo:
        @ Function supports interworking.
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        ldr     r3, .L2
        ldr     r2, [r3]
        and     r2, r2, #255
        orr     r2, r2, r0, asl #8
        str     r2, [r3]
        ldr     r2, [r3, #4]
        bic     r2, r2, #255
        orr     r0, r2, r0, lsr #24
        str     r0, [r3, #4]
        bx      lr

accesses 8 bytes


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]