This is the mail archive of the
mailing list for the GCC project.
[PATCH] Fix __builtin_apply_args on some targets (PR middle-end/37323)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 Nov 2008 17:31:51 +0100
- Subject: [PATCH] Fix __builtin_apply_args on some targets (PR middle-end/37323)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
The builtin_apply_args sequence depends on internal_arg_pointer.
This is on some targets a virtual register, but on others a pseudo
initialized for it. The builtin_apply_args sequence is unfortunately
emitted right after the very first note in the function, before
internal_arg_pointer is initialized.
The following patch instead puts it right before NOTE_INSN_FUNCTION_BEG.
Bootstrapped/regtested on x86_64-linux, tested and visually inspected
builtin-apply4.c also on i?86-linux, powerpc-linux and powerpc64-linux
and John David Anglin tested it on hppa64-hp-hpux11.11
and hppa-unknown-linux-gnu. Ok for trunk?
2008-11-10 Jakub Jelinek <firstname.lastname@example.org>
* builtins.c (expand_builtin_apply_args): Emit sequence before
parm_birth_insn instead of after entry_of_function's first insn.
--- gcc/builtins.c.jj 2008-11-03 11:15:08.000000000 +0100
+++ gcc/builtins.c 2008-11-09 11:50:35.000000000 +0100
@@ -1432,7 +1432,7 @@ expand_builtin_apply_args (void)
chain current, so the code is placed at the start of the
- emit_insn_before (seq, NEXT_INSN (entry_of_function ()));
+ emit_insn_before (seq, parm_birth_insn);