m68k structure packing

Jim Wilson wilson@cygnus.com
Tue Sep 30 21:42:00 GMT 1997


	> Gcc knows that it needs to access bitfields differently when a structure
	> is packed.  It may be that gcc will generate correct code with your patch
	> for cases that would ordinarily fail ...

	Yes it will.  I've used this on a number of occasions to get
	machine independant unaligned loads.  It works on all machines,
	even if gcc has to resort to byte loads and shifts.

I know that bitfield references to packed structures work.  This has never
been in doubt.

However, there remains a specific question here as to how this affects the
m68k port with respect to the known and documented problems with
PCC_BITFIELD_TYPE_MATTERS and STRUCTURE_SIZE_BOUNDARY.  It is not obvious
what the interaction is.  But as I mentioned in my previous mail, I am starting
to suspect that improvements to the unaligned/packed structure field support
over the years has accidentally solved this known problem, in which case this
may now be a `historical' problem.  If you haven't done so already, and if
you really care about this problem, take a look at the
PCC_BITFIELD_TYPE_MATTERS documentation.

Jim



More information about the Gcc mailing list