This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/65358] wrong parameter passing code with tail call optimization on arm
- From: "ktkachov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 Mar 2015 11:00:57 +0000
- Subject: [Bug target/65358] wrong parameter passing code with tail call optimization on arm
- Auto-submitted: auto-generated
- References: <bug-65358-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65358
--- Comment #15 from ktkachov at gcc dot gnu.org ---
Hmmm, actually it's not that simple, as testing showed.
The comment at the final load-to-regs code says:
/* If part should go in registers, copy that part
into the appropriate registers. Do this now, at the end,
since mem-to-mem copies above may do function calls. */
So just moving this at the beginning is not going to work.
Another question that comes up is: why didn't the code in calls.c not catch
that we're reading from a clobbered location and cancel the tail call?
It's supposed to do that with check_sibcall_argument_overlap at various points
in the expansion, but it doesn't catch this case.