problem with STACK_BOUNDARY=64 patch

Marc Lehmann
Mon Dec 15 04:28:00 GMT 1997

as you might know, pgcc now has STACK_BOUNDARY set to 64 for a long time now
(and the same is dicsussed for egcs, too).

Now I stumbled over a problem.. when STACK_BOUNDARY==64, egcs assumes (e.g.
in combine.c:nonzero_bits) that the FRAME_POINTER
_also_ is aligned to that boundary, which, on the x86, is wrong.

Interestingly, a comment in nonzero_bits says it's not safe to assume
STACK_BOUNDARY alignment for the argument pointer, so why does it assume
this is true for the frame pointer?

My question therefore: how do I tell egcs about the frame pointer alignment?

Currently, I solved this problem by adding another macro in i386.h, namely
FRAME_POINTER_ALIGNMENT (same semantics as STACK_BOUNDARY), and having
nonzero_bits check this.

I think that would be a clean solution (anybody got a better idea?), and this
could be extended to ARG_POINTER_ALIGNMENT, too, so that egcs can
use this extra information.

PS: the problem I had was combine changing (plus (reg) (4)) into
    (ior (reg) (4)) whenever reg contained an address.

      -----==-                                              |
      ----==-- _                                            |
      ---==---(_)__  __ ____  __       Marc Lehmann       +--
      --==---/ / _ \/ // /\ \/ /       |e|
      -=====/_/_//_/\_,_/ /_/\_\                          --+
    The choice of a GNU generation                        |

More information about the Gcc mailing list