diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2010-02-23 12:59:17 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2010-02-23 12:59:17 +0000 |
commit | c3382979d0016f6bf4e3cb2fbd48b951b24e35df (patch) | |
tree | 9fb8f64603818b3925ac8f939c7c8bf463bb6431 /gcc/sese.c | |
parent | 13cd10a221731f7393656e130078ac23083f82ec (diff) | |
download | gcc-c3382979d0016f6bf4e3cb2fbd48b951b24e35df.zip gcc-c3382979d0016f6bf4e3cb2fbd48b951b24e35df.tar.gz gcc-c3382979d0016f6bf4e3cb2fbd48b951b24e35df.tar.bz2 |
Fix PR43097: rename only SSA_NAMEs.
2010-02-22 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/43140
* sese.c (get_rename): Assert that old_name is an SSA_NAME.
(rename_variables_in_stmt): Continue when the use is not an SSA_NAME.
* gfortran.dg/graphite/pr43097.f: New.
From-SVN: r156995
Diffstat (limited to 'gcc/sese.c')
-rw-r--r-- | gcc/sese.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -494,6 +494,7 @@ get_rename (htab_t map, tree old_name) struct rename_map_elt_s tmp; PTR *slot; + gcc_assert (TREE_CODE (old_name) == SSA_NAME); tmp.old_name = old_name; slot = htab_find_slot (map, &tmp, NO_INSERT); @@ -658,14 +659,19 @@ rename_variables_in_stmt (gimple stmt, htab_t map, gimple_stmt_iterator *insert_ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES) { tree use = USE_FROM_PTR (use_p); - tree expr = get_rename (map, use); - tree type_use = TREE_TYPE (use); - tree type_expr = TREE_TYPE (expr); + tree expr, type_use, type_expr; gimple_seq stmts; + if (TREE_CODE (use) != SSA_NAME) + continue; + + expr = get_rename (map, use); if (use == expr) continue; + type_use = TREE_TYPE (use); + type_expr = TREE_TYPE (expr); + if (type_use != type_expr || (TREE_CODE (expr) != SSA_NAME && is_gimple_reg (use))) |