From: Richard Henderson Date: Thu, 1 Jul 2004 22:26:12 +0000 (-0700) Subject: tree-sra.c (sra_walk_expr): Don't maybe_lookup_element_for_expr in order to disable... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=78cc4167bcd0392c21b3db4682415245bfead558;p=gcc.git tree-sra.c (sra_walk_expr): Don't maybe_lookup_element_for_expr in order to disable scalarization. * tree-sra.c (sra_walk_expr): Don't maybe_lookup_element_for_expr in order to disable scalarization. Instead set a flag and wait for a candidate decl. From-SVN: r84001 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f8351e59bb7..c2512885a47 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-07-01 Richard Henderson + + * tree-sra.c (sra_walk_expr): Don't maybe_lookup_element_for_expr + in order to disable scalarization. Instead set a flag and wait + for a candidate decl. + 2004-07-01 Joseph S. Myers * doc/cppinternals.texi, doc/install.texi, doc/invoke.texi, diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 022da7d90af..2642dfea7ed 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -615,6 +615,7 @@ sra_walk_expr (tree *expr_p, block_stmt_iterator *bsi, bool is_output, { tree expr = *expr_p; tree inner = expr; + bool disable_scalarization = false; /* We're looking to collect a reference expression between EXPR and INNER, such that INNER is a scalarizable decl and all other nodes through EXPR @@ -632,7 +633,10 @@ sra_walk_expr (tree *expr_p, block_stmt_iterator *bsi, bool is_output, if (is_sra_candidate_decl (inner)) { struct sra_elt *elt = maybe_lookup_element_for_expr (expr); - fns->use (elt, expr_p, bsi, is_output); + if (disable_scalarization) + elt->cannot_scalarize = true; + else + fns->use (elt, expr_p, bsi, is_output); } return; @@ -649,14 +653,8 @@ sra_walk_expr (tree *expr_p, block_stmt_iterator *bsi, bool is_output, without duplicating too much code. */ if (!is_valid_const_index (inner)) { - if (fns->initial_scan) - { - struct sra_elt *elt - = maybe_lookup_element_for_expr (TREE_OPERAND (inner, 0)); - if (elt) - elt->cannot_scalarize = true; - } - return; + disable_scalarization = true; + goto use_all; } /* ??? Are we assured that non-constant bounds and stride will have the same value everywhere? I don't think Fortran will... */