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]

Re: STRICT_ALIGNMENT is too strict for m68k


Jim Wilson <wilson@cygnus.com> writes:

> 	It would be a very nice improvement if STRICT_ALIGNMENT were made to
> 	be conditional on the CPU implementation.
> 
> Changing the value of STRICT_ALIGNMENT changes the ABI.  In particular,
> it will affect structure layout.  It is generally unwise to have -mCPU
> options change the ABI, as most users won't want that.  It could
> perhaps be done for a particular target instead of all of them.  Or it
> could perhaps be done only if enabled by an option.  I think doing it
> for all m68k targets by default would be a bad idea.

Obviously I wasn't thinking about ABI.  I was thinking about a
memory-starved embedded system.  Turning off strict alignment shrinks
code size by 5%.  A better way to fix that system is to relax the
unnecessary uses of ((aligned (1), packed)), but this is legacy code
and doing that breaks other ports.  It's probably possible to debug
all ports so that structs can be unpacked, or packed at a 2-byte
boundary, but all of that takes time, and in the mean time, I'd like
to have the memory savings by flipping a switch.  I now have
`-m(no-)strict-align' implemented now as an Ascend-specific
SUBTARGET_SWITCHES.  Would you be willing to put `-m(no-)strict-align'
in TARGET_SWITCHES, issuing a warning when it is turned off on a CPU
that doesn't support unaligned access?


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