From: rakdver Date: Fri, 9 Sep 2005 16:17:25 +0000 (+0000) Subject: PR tree-optimization/23509 X-Git-Tag: upstream/4.9.2~58720 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d14b4c1584e4c22fd175c0932bd93f222403072d;p=platform%2Fupstream%2Flinaro-gcc.git 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104099 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dd7c384..549a9b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-09-09 Zdenek Dvorak + + 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. + 2005-09-09 Sebastian Pop * tree-chrec.c (evolution_function_is_invariant_rec_p): Use diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 3711556..75c14f4 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -1237,8 +1237,7 @@ replace_uses_by (tree name, tree val) FOR_EACH_IMM_USE_SAFE (use, imm_iter, name) { stmt = USE_STMT (use); - - SET_USE (use, val); + replace_exp (use, val); if (TREE_CODE (stmt) == PHI_NODE) { 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. */