diff options
author | Richard Guenther <rguenther@suse.de> | 2010-07-04 12:20:14 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-07-04 12:20:14 +0000 |
commit | 72aa3dcaf5e9aacc00c9ba56e05a750bcbd46415 (patch) | |
tree | 19aee9499609b52ccdddc46d9c961c4bf807e21c /gcc/tree-inline.c | |
parent | ef2a9157f4bbd2b7c5cd93328732a94970234173 (diff) | |
download | gcc-72aa3dcaf5e9aacc00c9ba56e05a750bcbd46415.zip gcc-72aa3dcaf5e9aacc00c9ba56e05a750bcbd46415.tar.gz gcc-72aa3dcaf5e9aacc00c9ba56e05a750bcbd46415.tar.bz2 |
re PR middle-end/44785 (Invalid memory access in gfortran.dg/extends_3.f03)
2010-07-04 Richard Guenther <rguenther@suse.de>
PR middle-end/44785
* tree-inline.c (initialize_inlined_parameters): Do not
re-use pointer-map slot over remap_type call.
From-SVN: r161800
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 3b1c459..46c604f 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2690,19 +2690,20 @@ initialize_inlined_parameters (copy_body_data *id, gimple stmt, if (varp && TREE_CODE (*varp) == VAR_DECL) { - tree def = (gimple_in_ssa_p (cfun) + tree def = (gimple_in_ssa_p (cfun) && is_gimple_reg (p) ? gimple_default_def (id->src_cfun, p) : NULL); - TREE_TYPE (*varp) = remap_type (TREE_TYPE (*varp), id); + tree var = *varp; + TREE_TYPE (var) = remap_type (TREE_TYPE (var), 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)) + if (def) { 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); + && SSA_NAME_VAR (*defp) == var) + TREE_TYPE (*defp) = TREE_TYPE (var); } } } |