This is the mail archive of the gcc@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]

RE: Folding a bitfield in a union


> From: Richard Biener [mailto:richard.guenther@gmail.com]
> Sent: Friday, June 27, 2014 6:23 PM
> 
> Yes - I was specifically looking for an early out to avoid wrong-code.
> So, is size % BITS_PER_UNIT != 0 a working fix to avoid the wrong-code
> issues with bitfields (on big-endian targets)?

I'm afraid not. A bitfield of 24 bits passes this test but the folding with
VIEW_CONVERT_EXPR is still wrong. Better compare size against the bitsize
of type. That would eliminate all bitfields.

> 
> I'd rather disable it for all endianesses - gives us more incentive
> to fix it properly.

Ok.

> 
> Yeah (the code is already there in varasm.c:output_constructor - it
> just uses a different "buffer").

Good, I'll take a look at it when I'll come back to this patch.

Best regards,

Thomas



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