[patch] h8300.md: Optimize stack pushes.
Kazu Hirata
kazu@cs.umass.edu
Mon Jul 7 18:10:00 GMT 2003
Hi Alexandre,
> > However, as far as the hardware is concerned, the stack pointer
> > address is only required to be a multiple of 2, not 4, so we can push
> > 2 bytes, reg:HI, and then subtract 2 from the stack pointer.
>
> What if an interrupt occurs, or a signal is delivered, between the two
> instructions? Then the stack pointer will be misaligned.
I don't think that would be a problem unless the interrupt service
routine starts digging into the stack upward and tries to do something
with it. The actual alignment for the stack is 2 bytes.
PUSH_ROUNDING implies 4 byte alignment on the surface, but that's is
only needed to ensure that a caller can talk to a callee.
Kazu Hirata
More information about the Gcc-patches
mailing list