From: Andrew MacLeod Date: Mon, 31 Oct 2005 13:38:05 +0000 (+0000) Subject: re PR tree-optimization/19097 (Quadratic behavior with many sets for the same registe... X-Git-Tag: releases/gcc-4.1.0~1140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a56b5394f0419486583aef0de3ac6c71175486a8;p=thirdparty%2Fgcc.git re PR tree-optimization/19097 (Quadratic behavior with many sets for the same register in VRP) 2005-10-31 Andrew MacLeod PR tree-optimization/19097 * tree-ssa-operands.c (correct_use_link): Don't look for modified stmts. From-SVN: r106272 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cd55c36ff127..2f77e79491c1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-10-31 Andrew MacLeod + + PR tree-optimization/19097 + * tree-ssa-operands.c (correct_use_link): Don't look for modified stmts. + 2005-10-31 J"orn Rennecke * optabs.c (expand_unop): Take TRULY_NOOP_TRUNCATION into account. diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 30845546d287..024762961236 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -311,27 +311,12 @@ correct_use_link (use_operand_p ptr, tree stmt) prev = ptr->prev; if (prev) { - bool stmt_mod = true; - /* Find the first element which isn't a SAFE iterator, is in a different - stmt, and is not a modified stmt. That node is in the correct list, - see if we are too. */ - - while (stmt_mod) - { - while (prev->stmt == stmt || prev->stmt == NULL) - prev = prev->prev; - if (prev->use == NULL) - stmt_mod = false; - else - if ((stmt_mod = stmt_modified_p (prev->stmt))) - prev = prev->prev; - } + /* Find the root element, making sure we skip any safe iterators. */ + while (prev->use != NULL || prev->stmt == NULL) + prev = prev->prev; /* Get the ssa_name of the list the node is in. */ - if (prev->use == NULL) - root = prev->stmt; - else - root = *(prev->use); + root = prev->stmt; /* If it's the right list, simply return. */ if (root == *(ptr->use)) return;