This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/27386] AVR: wrong code generated when passing three uint64_t arguments to function
- From: "rask at sygehus dot dk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 May 2007 21:29:46 -0000
- Subject: [Bug target/27386] AVR: wrong code generated when passing three uint64_t arguments to function
- References: <bug-27386-11199@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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