struct packing on m68k

Kamil Iskra kamil@dwd.interkom.pl
Wed Sep 24 07:55:00 GMT 1997


On 24 Sep 1997, Andreas Schwab wrote:

> Mike Stump <mrs@wrs.com> writes:
> |> The only issue that I know of is, will the compiler ever emit bad code
> |> if the alignment is shortened?  I was hoping that the answer was no,
> |> but, in the absence of knowledge...
> The only place where it can fail is on a STRICT_ALIGNMENT target when
> using a packed structure in an array.  I don't know whether the compiler
> already handles unaligned array accesses.

I don't know how it handles structure members in unaligned structure, but
apparently it handles structure bitfields quite well. I've disabled
STRUCTURE_SIZE_BOUNDARY for the m68k-amigaos port in order to match the
AmigaOS ABI, and since then we've compiled lots of free software with such
a compiler without any problems. According to tm.texi, this shouldn't
work, since on targets that don't have bitfield access patterns (and
that's the case with the plain 68000) either STRUCTURE_SIZE_BOUNDARY
should be equal to BIGGEST_ALIGNMENT, or PCC_BITFIELD_TYPE_MATTERS should
be defined. Yet, our port works fine with neither of these two defined,
or, at least, we weren't able to find a testcase that fails...

/ Kamil Iskra - AMIGA 1200, 68030 50MHz, HDD 1.6 GB, 18 MB RAM \
| iskra@student.uci.agh.edu.pl  kiskra@ernie.icslab.agh.edu.pl |
| http://student.uci.agh.edu.pl/~iskra                         |
\ PGP public key available via Finger or WWW                   /




More information about the Gcc mailing list