Subject: Re: powerpc gcc alignment problem
To: David Edelsohn <dje@watson.ibm.com>
From: Dan Winship <danw@MIT.EDU>
List: tech-toolchain
Date: 12/28/1999 16:09:12
>         So you want to decrease preformance for all programs because a few
> explicitly want to define misaligned structures?  Seems backwards to me.

No. That's intended only as a short-term kludge.

In the longer term, I want to make gcc recognize the fact that those
structures are misaligned on the ppc and deal accordingly.

One possibility would be replacing several of the uses of
STRICT_ALIGNMENT followed by an alignment check with something like a
"SUFFICIENTLY_ALIGNED" macro that would take a mode and an alignment
and return whether or not that mode could be used with that alignment.
For most archictures, it would end up defaulting to something like:

#define SUFFICIENTLY_ALIGNED (mode, align) \
	(! STRICT_ALIGNMENT || (GET_MODE_ALIGNMENT (mode) >= align))

But for the PowerPC it would be something like

#define SUFFICIENTLY_ALIGNED (mode, align) \
	((mode != DImode && mode != DFmode) || align >= 4)

-- Dan