------- Comment #12 from rask at sygehus dot dk 2007-05-30 21:29 ------- The AVR is unusual in having
#define STACK_PUSH_CODE POST_DEC #define STACK_GROWS_DOWNWARD where most targets would have PRE_DEC when the stack grows downward. The middle-end tries to synthesize the missing pushdi pattern, but while the offsets seem to be wrong in any case, the instruction order would be correct for PRE_DEC. In expr.c/emit_single_push_insn(), there is this comment: #ifdef STACK_GROWS_DOWNWARD /* ??? This seems wrong if STACK_PUSH_CODE == POST_DEC. */ dest_addr = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (-(HOST_WIDE_INT) rounded_size)); #else Someone needs to set a breakpoint on emit_push_insn() and friends to find out exactly where the problem is. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27386