From 006e317a14aca1c3d19485b66df07007bf07694e Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 7 Apr 2015 23:02:12 +0200 Subject: re PR ipa/65540 (internal error on s-fatllf.ads at -O2) PR ipa/65540 * calls.c (initialize_argument_information): When producing tail call also turn SSA_NAMES passed by references to original PARM_DECLs * gcc.c-torture/compile/pr65540.c: New. From-SVN: r221910 --- gcc/calls.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/calls.c') diff --git a/gcc/calls.c b/gcc/calls.c index ec44624..970415d 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1321,6 +1321,15 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, && TREE_CODE (base) != SSA_NAME && (!DECL_P (base) || MEM_P (DECL_RTL (base))))) { + /* We may have turned the parameter value into an SSA name. + Go back to the original parameter so we can take the + address. */ + if (TREE_CODE (args[i].tree_value) == SSA_NAME) + { + gcc_assert (SSA_NAME_IS_DEFAULT_DEF (args[i].tree_value)); + args[i].tree_value = SSA_NAME_VAR (args[i].tree_value); + gcc_assert (TREE_CODE (args[i].tree_value) == PARM_DECL); + } /* Argument setup code may have copied the value to register. We revert that optimization now because the tail call code must use the original location. */ -- cgit v1.1