]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
loop-iv.c (simple_rhs_p): Allow expressions that are function_invariant_p.
authorBernd Schmidt <bernd.schmidt@analog.com>
Fri, 24 Apr 2009 11:05:59 +0000 (11:05 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Fri, 24 Apr 2009 11:05:59 +0000 (11:05 +0000)
* loop-iv.c (simple_rhs_p): Allow expressions that are
function_invariant_p.

From-SVN: r146701

gcc/ChangeLog
gcc/loop-iv.c

index 2ac01312b51458c48dc5a1246508841fac361a9b..688783ec60574ee647b86aca932a3c9464d24d67 100644 (file)
@@ -3,6 +3,7 @@
        * loop-iv.c (replace_single_def_regs): Look for REG_EQUAL notes;
        follow chains of regs with a single definition, and allow expressions
        that are function_invariant_p.
+       (simple_rhs_p): Allow expressions that are function_invariant_p.
 
 2009-04-24  Paolo Bonzini  <bonzini@gnu.org>
 
index 23ece7eea8cb83819ba8421294de6c522adea15b..be7fda81372906fd2265ae05434de79ca6a71d8d 100644 (file)
@@ -1341,10 +1341,10 @@ simple_rhs_p (rtx rhs)
       op1 = XEXP (rhs, 1);
       /* Allow reg OP const and reg OP reg.  */
       if (!(REG_P (op0) && !HARD_REGISTER_P (op0))
-         && !CONSTANT_P (op0))
+         && !function_invariant_p (op0))
        return false;
       if (!(REG_P (op1) && !HARD_REGISTER_P (op1))
-         && !CONSTANT_P (op1))
+         && !function_invariant_p (op1))
        return false;
 
       return true;
@@ -1358,7 +1358,7 @@ simple_rhs_p (rtx rhs)
       /* Allow reg OP const.  */
       if (!(REG_P (op0) && !HARD_REGISTER_P (op0)))
        return false;
-      if (!CONSTANT_P (op1))
+      if (!function_invariant_p (op1))
        return false;
 
       return true;