From a82ff31f392508ef56c4021a711ec08982dadf76 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 17 Mar 2011 21:33:54 +0100 Subject: [PATCH] re PR debug/48163 (ICEs for cris-elf, like gcc.c-torture/compile/calls.c gcc.c-torture/execute/complex-1.c) PR debug/48163 * function.c (assign_parms): For data.passed_pointer parms use MEM of data.entry_parm instead of data.entry_parm itself as DECL_INCOMING_RTL. * dwarf2out.c (rtl_for_decl_location): Use DECL_INCOMING_RTL also when passed and declared mode is the same, DECL_RTL is a MEM with pseudo as address and DECL_INCOMING_RTL is a MEM too. From-SVN: r171113 --- gcc/ChangeLog | 11 +++++++++++ gcc/dwarf2out.c | 11 +++++++++-- gcc/function.c | 10 +++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5182971d685..3e4a5114572 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2011-03-17 Jakub Jelinek + + PR debug/48163 + * function.c (assign_parms): For data.passed_pointer parms + use MEM of data.entry_parm instead of data.entry_parm itself + as DECL_INCOMING_RTL. + * dwarf2out.c (rtl_for_decl_location): Use DECL_INCOMING_RTL + also when passed and declared mode is the same, DECL_RTL + is a MEM with pseudo as address and DECL_INCOMING_RTL is + a MEM too. + 2011-03-16 Jeff Law PR rtl-optimization/37273 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index f62bb48737c..31d9a0e9925 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -16721,7 +16721,13 @@ rtl_for_decl_location (tree decl) } else if (TREE_CODE (decl) == PARM_DECL) { - if (rtl == NULL_RTX || is_pseudo_reg (rtl)) + if (rtl == NULL_RTX + || is_pseudo_reg (rtl) + || (MEM_P (rtl) + && is_pseudo_reg (XEXP (rtl, 0)) + && DECL_INCOMING_RTL (decl) + && MEM_P (DECL_INCOMING_RTL (decl)) + && GET_MODE (rtl) == GET_MODE (DECL_INCOMING_RTL (decl)))) { tree declared_type = TREE_TYPE (decl); tree passed_type = DECL_ARG_TYPE (decl); @@ -16733,7 +16739,8 @@ rtl_for_decl_location (tree decl) all cases where (rtl == NULL_RTX) just below. */ if (dmode == pmode) rtl = DECL_INCOMING_RTL (decl); - else if (SCALAR_INT_MODE_P (dmode) + else if ((rtl == NULL_RTX || is_pseudo_reg (rtl)) + && SCALAR_INT_MODE_P (dmode) && GET_MODE_SIZE (dmode) <= GET_MODE_SIZE (pmode) && DECL_INCOMING_RTL (decl)) { diff --git a/gcc/function.c b/gcc/function.c index 1f7722c62a2..64950a1a799 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -3403,7 +3403,15 @@ assign_parms (tree fndecl) } /* Record permanently how this parm was passed. */ - set_decl_incoming_rtl (parm, data.entry_parm, data.passed_pointer); + if (data.passed_pointer) + { + rtx incoming_rtl + = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (data.passed_type)), + data.entry_parm); + set_decl_incoming_rtl (parm, incoming_rtl, true); + } + else + set_decl_incoming_rtl (parm, data.entry_parm, false); /* Update info on where next arg arrives in registers. */ targetm.calls.function_arg_advance (&all.args_so_far, data.promoted_mode, -- 2.30.2