From: rakdver Date: Mon, 19 Dec 2005 20:10:11 +0000 (+0000) Subject: PR tree-optimization/24793 X-Git-Tag: upstream/4.9.2~56885 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca9c9daf1df4c83d13081ec49928e111da607570;p=platform%2Fupstream%2Flinaro-gcc.git PR tree-optimization/24793 * tree-ssa-loop-ivopts.c (get_ref_tag): Remember the original reference if there are subvars. * tree-ssa-operands.c (get_tmr_operands): Handle subvars. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108808 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aeddaca..fdaf09f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,12 @@ +2005-12-19 Zdenek Dvorak + + PR tree-optimization/24793 + * tree-ssa-loop-ivopts.c (get_ref_tag): Remember the + original reference if there are subvars. + * tree-ssa-operands.c (get_tmr_operands): Handle subvars. + 2005-12-19 Kenneth Zadeck + * df.c (df_analyze_1, df_analyze_subcfg, iterative_dataflow): Corrected basic block number calculations for changes in entry and exit numbering. diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 4affcf4..6e7dd61 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -5490,10 +5490,21 @@ unshare_and_remove_ssa_names (tree ref) and extracts this single useful piece of information. */ static tree -get_ref_tag (tree ref) +get_ref_tag (tree ref, tree orig) { tree var = get_base_address (ref); - tree tag; + tree aref = NULL_TREE, tag, sv; + HOST_WIDE_INT offset, size, maxsize; + + for (sv = orig; handled_component_p (sv); sv = TREE_OPERAND (sv, 0)) + { + aref = get_ref_base_and_extent (sv, &offset, &size, &maxsize); + if (ref) + break; + } + + if (aref && SSA_VAR_P (aref) && get_subvars_for_var (aref)) + return unshare_expr (sv); if (!var) return NULL_TREE; @@ -5540,8 +5551,8 @@ copy_ref_info (tree new_ref, tree old_ref) copy_mem_ref_info (new_ref, old_ref); else { - TMR_TAG (new_ref) = get_ref_tag (old_ref); TMR_ORIGINAL (new_ref) = unshare_and_remove_ssa_names (old_ref); + TMR_TAG (new_ref) = get_ref_tag (old_ref, TMR_ORIGINAL (new_ref)); } } diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 236db30..01bf7f2 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1465,7 +1465,10 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags) static void get_tmr_operands (tree stmt, tree expr, int flags) { - tree tag = TMR_TAG (expr); + tree tag = TMR_TAG (expr), ref; + HOST_WIDE_INT offset, size, maxsize; + subvar_t svars, sv; + stmt_ann_t s_ann = stmt_ann (stmt); /* First record the real operands. */ get_expr_operands (stmt, &TMR_BASE (expr), opf_none); @@ -1480,11 +1483,33 @@ get_tmr_operands (tree stmt, tree expr, int flags) add_to_addressable_set (TMR_SYMBOL (expr), &ann->addresses_taken); } - if (tag) - get_expr_operands (stmt, &tag, flags); - else - /* Something weird, so ensure that we will be careful. */ - stmt_ann (stmt)->has_volatile_ops = true; + if (!tag) + { + /* Something weird, so ensure that we will be careful. */ + stmt_ann (stmt)->has_volatile_ops = true; + return; + } + + if (DECL_P (tag)) + { + get_expr_operands (stmt, &tag, flags); + return; + } + + ref = get_ref_base_and_extent (tag, &offset, &size, &maxsize); + gcc_assert (ref != NULL_TREE); + svars = get_subvars_for_var (ref); + for (sv = svars; sv; sv = sv->next) + { + bool exact; + if (overlap_subvar (offset, maxsize, sv, &exact)) + { + int subvar_flags = flags; + if (!exact || size != maxsize) + subvar_flags &= ~opf_kill_def; + add_stmt_operand (&sv->var, s_ann, subvar_flags); + } + } } /* A subroutine of get_expr_operands to handle CALL_EXPR. */