tree-nested.c (build_addr): Merge real/imagpart with handled_component_p.
* tree-nested.c (build_addr): Merge real/imagpart with handled_component_p. (convert_nonlocal_reference, convert_local_reference): Process extra args to COMPONENT_REF and ARRAY_REF. * tree-outof-ssa.c (discover_nonconstant_array_refs_r): Check for lower bound and field offset being constant. From-SVN: r83677
This commit is contained in:
parent
e804f82290
commit
8f44bc38a5
@ -1,3 +1,12 @@
|
|||||||
|
2004-06-25 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
|
||||||
|
|
||||||
|
* tree-nested.c (build_addr): Merge real/imagpart with
|
||||||
|
handled_component_p.
|
||||||
|
(convert_nonlocal_reference, convert_local_reference): Process extra
|
||||||
|
args to COMPONENT_REF and ARRAY_REF.
|
||||||
|
* tree-outof-ssa.c (discover_nonconstant_array_refs_r): Check for
|
||||||
|
lower bound and field offset being constant.
|
||||||
|
|
||||||
2004-06-25 Mark Mitchell <mark@codesourcery.com>
|
2004-06-25 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
PR wrong-code/16129
|
PR wrong-code/16129
|
||||||
|
@ -158,11 +158,9 @@ build_addr (tree exp)
|
|||||||
{
|
{
|
||||||
tree base = exp;
|
tree base = exp;
|
||||||
|
|
||||||
if (TREE_CODE (base) == REALPART_EXPR || TREE_CODE (base) == IMAGPART_EXPR)
|
while (TREE_CODE (base) == REALPART_EXPR || TREE_CODE (base) == IMAGPART_EXPR
|
||||||
|
|| handled_component_p (base))
|
||||||
base = TREE_OPERAND (base, 0);
|
base = TREE_OPERAND (base, 0);
|
||||||
else
|
|
||||||
while (handled_component_p (base))
|
|
||||||
base = TREE_OPERAND (base, 0);
|
|
||||||
|
|
||||||
if (DECL_P (base))
|
if (DECL_P (base))
|
||||||
TREE_ADDRESSABLE (base) = 1;
|
TREE_ADDRESSABLE (base) = 1;
|
||||||
@ -797,7 +795,6 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COMPONENT_REF:
|
|
||||||
case REALPART_EXPR:
|
case REALPART_EXPR:
|
||||||
case IMAGPART_EXPR:
|
case IMAGPART_EXPR:
|
||||||
wi->val_only = false;
|
wi->val_only = false;
|
||||||
@ -805,6 +802,13 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
|
|||||||
wi->val_only = true;
|
wi->val_only = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case COMPONENT_REF:
|
||||||
|
wi->val_only = false;
|
||||||
|
walk_tree (&TREE_OPERAND (t, 0), convert_nonlocal_reference, wi, NULL);
|
||||||
|
wi->val_only = true;
|
||||||
|
walk_tree (&TREE_OPERAND (t, 2), convert_nonlocal_reference, wi, NULL);
|
||||||
|
break;
|
||||||
|
|
||||||
case ARRAY_REF:
|
case ARRAY_REF:
|
||||||
case ARRAY_RANGE_REF:
|
case ARRAY_RANGE_REF:
|
||||||
wi->val_only = false;
|
wi->val_only = false;
|
||||||
@ -932,7 +936,6 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
|
|||||||
tsi_link_after (&wi->tsi, x, TSI_SAME_STMT);
|
tsi_link_after (&wi->tsi, x, TSI_SAME_STMT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COMPONENT_REF:
|
|
||||||
case REALPART_EXPR:
|
case REALPART_EXPR:
|
||||||
case IMAGPART_EXPR:
|
case IMAGPART_EXPR:
|
||||||
wi->val_only = false;
|
wi->val_only = false;
|
||||||
@ -940,6 +943,13 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
|
|||||||
wi->val_only = true;
|
wi->val_only = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case COMPONENT_REF:
|
||||||
|
wi->val_only = false;
|
||||||
|
walk_tree (&TREE_OPERAND (t, 0), convert_local_reference, wi, NULL);
|
||||||
|
wi->val_only = true;
|
||||||
|
walk_tree (&TREE_OPERAND (t, 2), convert_local_reference, wi, NULL);
|
||||||
|
break;
|
||||||
|
|
||||||
case ARRAY_REF:
|
case ARRAY_REF:
|
||||||
case ARRAY_RANGE_REF:
|
case ARRAY_RANGE_REF:
|
||||||
wi->val_only = false;
|
wi->val_only = false;
|
||||||
|
@ -1763,17 +1763,21 @@ discover_nonconstant_array_refs_r (tree * tp, int *walk_subtrees,
|
|||||||
|
|
||||||
if (TYPE_P (t) || DECL_P (t))
|
if (TYPE_P (t) || DECL_P (t))
|
||||||
*walk_subtrees = 0;
|
*walk_subtrees = 0;
|
||||||
else if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
|
if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
|
||||||
{
|
{
|
||||||
while (((TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
|
while (((TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
|
||||||
&& is_gimple_min_invariant (TREE_OPERAND (t, 1)))
|
&& is_gimple_min_invariant (TREE_OPERAND (t, 1))
|
||||||
|
&& (!TREE_OPERAND (t, 2)
|
||||||
|
|| is_gimple_min_invariant (TREE_OPERAND (t, 2))))
|
||||||
|| (TREE_CODE (t) == COMPONENT_REF
|
|| (TREE_CODE (t) == COMPONENT_REF
|
||||||
|| TREE_CODE (t) == BIT_FIELD_REF
|
&& (!TREE_OPERAND (t,2)
|
||||||
|| TREE_CODE (t) == REALPART_EXPR
|
|| is_gimple_min_invariant (TREE_OPERAND (t, 2))))
|
||||||
|| TREE_CODE (t) == IMAGPART_EXPR
|
|| TREE_CODE (t) == BIT_FIELD_REF
|
||||||
|| TREE_CODE (t) == VIEW_CONVERT_EXPR
|
|| TREE_CODE (t) == REALPART_EXPR
|
||||||
|| TREE_CODE (t) == NOP_EXPR
|
|| TREE_CODE (t) == IMAGPART_EXPR
|
||||||
|| TREE_CODE (t) == CONVERT_EXPR))
|
|| TREE_CODE (t) == VIEW_CONVERT_EXPR
|
||||||
|
|| TREE_CODE (t) == NOP_EXPR
|
||||||
|
|| TREE_CODE (t) == CONVERT_EXPR)
|
||||||
t = TREE_OPERAND (t, 0);
|
t = TREE_OPERAND (t, 0);
|
||||||
|
|
||||||
if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
|
if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
|
||||||
|
Loading…
Reference in New Issue
Block a user