On Tue, Oct 13, 2015 at 12:10 PM, Eric Botcazou <ebotca...@adacore.com> wrote: >> Two functional changes I'd like to point out: >> >> /* ALIGN FRAMES on double word boundaries */ >> -#define SPARC_STACK_ALIGN(LOC) \ >> - (TARGET_ARCH64 ? (((LOC)+15) & ~15) : (((LOC)+7) & ~7)) >> +#define SPARC_STACK_ALIGN(LOC) ROUND_UP ((LOC), UNITS_PER_WORD * 2) >> >> The one above uses UNITS_PER_WORD in stack alignment calculation > > OK. > >> /* Always preserve double-word alignment. */ >> - offset = (offset + 8) & -8; >> + offset = ROUND_UP (offset, 8); >> >> The one above looks like off-by-one bug, but this needs a confirmation. > > No, it's correct, it's a bump of 8 followed by a ROUND_DOWN (the offset may or > may not have been bumped by 4 already in the code just above).
In this case, I think it is better to write this part as: --cut here-- offset += 8; /* Always preserve double-word alignment. */ offset = ROUND_DOWN (offset, 8); --cut here-- WDYT? Uros.