From ea184343e7fff4b72434947715374498eafa55f9 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Tue, 29 Jun 2010 12:12:10 +0000 Subject: [PATCH] re PR tree-optimization/44667 (ICE: verify_stmts failed: non-trivial conversion at assignment with -fprofile-generate) 2010-06-29 Richard Guenther PR middle-end/44667 * tree-inline.c (initialize_inlined_parameters): Make sure to remap the inlined parameter variable substitutions types. From-SVN: r161527 --- gcc/ChangeLog | 6 ++++++ gcc/tree-inline.c | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7eeef8dfd08..2a645299e39 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-06-29 Richard Guenther + + PR middle-end/44667 + * tree-inline.c (initialize_inlined_parameters): Make sure + to remap the inlined parameter variable substitutions types. + 2010-06-29 Eric Botcazou PR rtl-optimization/44659 diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index a419c2612bf..2604c6b1127 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2642,6 +2642,32 @@ initialize_inlined_parameters (copy_body_data *id, gimple stmt, val = i < gimple_call_num_args (stmt) ? gimple_call_arg (stmt, i) : NULL; setup_one_parameter (id, p, val, fn, bb, &vars); } + /* After remapping parameters remap their types. This has to be done + in a second loop over all parameters to appropriately remap + variable sized arrays when the size is specified in a + parameter following the array. */ + for (p = parms, i = 0; p; p = TREE_CHAIN (p), i++) + { + tree *varp = (tree *) pointer_map_contains (id->decl_map, p); + if (varp + && TREE_CODE (*varp) == VAR_DECL) + { + tree def = (gimple_in_ssa_p (cfun) + ? gimple_default_def (id->src_cfun, p) : NULL); + TREE_TYPE (*varp) = remap_type (TREE_TYPE (*varp), id); + /* Also remap the default definition if it was remapped + to the default definition of the parameter replacement + by the parameter setup. */ + if (def && gimple_in_ssa_p (cfun) && is_gimple_reg (p)) + { + tree *defp = (tree *) pointer_map_contains (id->decl_map, def); + if (defp + && TREE_CODE (*defp) == SSA_NAME + && SSA_NAME_VAR (*defp) == *varp) + TREE_TYPE (*defp) = TREE_TYPE (*varp); + } + } + } /* Initialize the static chain. */ p = DECL_STRUCT_FUNCTION (fn)->static_chain_decl; -- 2.30.2