aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-ivopts.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2005-09-09 18:17:25 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2005-09-09 16:17:25 +0000
commit2360a4c1a67232511351afd4986ef9e1e2a73c36 (patch)
treeb0daab8bce72e580a6b7781d87afabad44aeb1f3 /gcc/tree-ssa-loop-ivopts.c
parent8f0960834317f5a64a9246b0321b5f90f9faaf05 (diff)
downloadgcc-2360a4c1a67232511351afd4986ef9e1e2a73c36.zip
gcc-2360a4c1a67232511351afd4986ef9e1e2a73c36.tar.gz
gcc-2360a4c1a67232511351afd4986ef9e1e2a73c36.tar.bz2
re PR tree-optimization/23509 (ICE with ivopts)
PR tree-optimization/23509 * tree-cfg.c (replace_uses_by): Use replace_exp. * tree-ssa-loop-ivopts.c (get_ref_tag): Assert that dereferenced pointers have name_mem_tag or type_mem_tag set. From-SVN: r104099
Diffstat (limited to 'gcc/tree-ssa-loop-ivopts.c')
-rw-r--r--gcc/tree-ssa-loop-ivopts.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index d0a186a..44ebc5c 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -5448,9 +5448,13 @@ get_ref_tag (tree ref)
return NULL_TREE;
if (TREE_CODE (var) == INDIRECT_REF)
- var = TREE_OPERAND (var, 0);
- if (TREE_CODE (var) == SSA_NAME)
{
+ /* In case the base is a dereference of a pointer, first check its name
+ mem tag, and if it does not have one, use type mem tag. */
+ var = TREE_OPERAND (var, 0);
+ if (TREE_CODE (var) != SSA_NAME)
+ return NULL_TREE;
+
if (SSA_NAME_PTR_INFO (var))
{
tag = SSA_NAME_PTR_INFO (var)->name_mem_tag;
@@ -5459,18 +5463,21 @@ get_ref_tag (tree ref)
}
var = SSA_NAME_VAR (var);
+ tag = var_ann (var)->type_mem_tag;
+ gcc_assert (tag != NULL_TREE);
+ return tag;
}
-
- if (DECL_P (var))
- {
+ else
+ {
+ if (!DECL_P (var))
+ return NULL_TREE;
+
tag = var_ann (var)->type_mem_tag;
if (tag)
return tag;
return var;
}
-
- return NULL_TREE;
}
/* Copies the reference information from OLD_REF to NEW_REF. */