aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-12-05 17:52:16 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2008-12-05 17:52:16 +0100
commit1f21b6f4adea6c5d82dc5fe2820b3848e81504a5 (patch)
tree9d62d6176a2544f214e82ea54ad9eedfeacc163e /gcc/builtins.c
parentc187a21f76390d3bfd0ca2235ec432c23147f957 (diff)
downloadgcc-1f21b6f4adea6c5d82dc5fe2820b3848e81504a5.zip
gcc-1f21b6f4adea6c5d82dc5fe2820b3848e81504a5.tar.gz
gcc-1f21b6f4adea6c5d82dc5fe2820b3848e81504a5.tar.bz2
re PR middle-end/38338 (__builtin_apply causes an ICE on x86)
PR middle-end/38338 * builtins.c (expand_builtin_apply_args): Put before parm_birth_insn only if internal_arg_pointer is a non-virtual pseudo. * gcc.dg/pr38338.c: New test. From-SVN: r142480
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 444baa6..4d507cf 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -1434,9 +1434,15 @@ expand_builtin_apply_args (void)
/* Put the insns after the NOTE that starts the function.
If this is inside a start_sequence, make the outer-level insn
chain current, so the code is placed at the start of the
- function. */
+ function. If internal_arg_pointer is a non-virtual pseudo,
+ it needs to be placed after the function that initializes
+ that pseudo. */
push_topmost_sequence ();
- emit_insn_before (seq, parm_birth_insn);
+ if (REG_P (crtl->args.internal_arg_pointer)
+ && REGNO (crtl->args.internal_arg_pointer) > LAST_VIRTUAL_REGISTER)
+ emit_insn_before (seq, parm_birth_insn);
+ else
+ emit_insn_before (seq, NEXT_INSN (entry_of_function ()));
pop_topmost_sequence ();
return temp;
}