]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
(loop_iterations): Only use REG_EQUAL note value if it
authorJim Wilson <wilson@gcc.gnu.org>
Sun, 3 Jul 1994 01:14:43 +0000 (18:14 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Sun, 3 Jul 1994 01:14:43 +0000 (18:14 -0700)
is constant.

From-SVN: r7648

gcc/unroll.c

index 3f628bddc8a7353efd438dd1f9050123e9d755a1..9b968ac9696cd4ba91f56bd23fcf80ea8644482e 100644 (file)
@@ -3160,7 +3160,11 @@ loop_iterations (loop_start, loop_end)
                {
                  rtx note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
 
-                 if (note && GET_CODE (XEXP (note, 0)) != EXPR_LIST)
+                 /* Only use the REG_EQUAL note if it is a constant.
+                    Other things, divide in particular, will cause
+                    problems later if we use them.  */
+                 if (note && GET_CODE (XEXP (note, 0)) != EXPR_LIST
+                     && CONSTANT_P (XEXP (note, 0)))
                    comparison_value = XEXP (note, 0);
                }
              break;