diff options
author | Richard Guenther <rguenther@suse.de> | 2010-06-29 12:12:10 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-06-29 12:12:10 +0000 |
commit | ea184343e7fff4b72434947715374498eafa55f9 (patch) | |
tree | d5b47eaff1af577e41acf6dbf40f53feede97e25 /gcc/tree-inline.c | |
parent | 6ff7e9643524b5cad27a5c180028908db73f1fd6 (diff) | |
download | gcc-ea184343e7fff4b72434947715374498eafa55f9.zip gcc-ea184343e7fff4b72434947715374498eafa55f9.tar.gz gcc-ea184343e7fff4b72434947715374498eafa55f9.tar.bz2 |
re PR tree-optimization/44667 (ICE: verify_stmts failed: non-trivial conversion at assignment with -fprofile-generate)
2010-06-29 Richard Guenther <rguenther@suse.de>
PR middle-end/44667
* tree-inline.c (initialize_inlined_parameters): Make sure
to remap the inlined parameter variable substitutions types.
From-SVN: r161527
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index a419c26..2604c6b 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; |