re PR tree-optimization/24793 (ICE: expected ssa_name, have var_decl in verify_ssa, at tree-ssa.c:746)

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.

From-SVN: r108808
This commit is contained in:
Zdenek Dvorak 2005-12-19 21:10:11 +01:00 committed by Zdenek Dvorak
parent 0bae56c460
commit 9be7ee44c4
3 changed files with 53 additions and 9 deletions

View File

@ -1,4 +1,12 @@
2005-12-19 Zdenek Dvorak <dvorakz@suse.cz>
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 <zadeck@naturalbridge.com>
* df.c (df_analyze_1, df_analyze_subcfg, iterative_dataflow):
Corrected basic block number calculations for changes in entry and
exit numbering.

View File

@ -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));
}
}

View File

@ -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. */