(strength_reduce): If HAVE_cc0 defined, disable auto_inc_opt
authorJim Wilson <wilson@gcc.gnu.org>
Thu, 6 Jun 1996 19:05:21 +0000 (12:05 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Thu, 6 Jun 1996 19:05:21 +0000 (12:05 -0700)
if it would put an insn between a cc0 setter/user pair.

From-SVN: r12176

gcc/loop.c

index 0ee43c9e509d6c056ccfab795a04dc49ab9d6ed2..8e48236ca78e7c5dbb20681a23bba32cc8d6da13 100644 (file)
@@ -3937,6 +3937,15 @@ strength_reduce (scan_start, end, loop_top, insn_count,
                  else
                    auto_inc_opt = 1;
 
+#ifdef HAVE_cc0
+                 /* We can't put an insn immediately after one setting
+                    cc0, or immediately before one using cc0.  */
+                 if ((auto_inc_opt == 1 && sets_cc0_p (PATTERN (v->insn)))
+                     || (auto_inc_opt == -1
+                         && sets_cc0_p (PATTERN (prev_nonnote_insn (v->insn)))))
+                   auto_inc_opt = 0;
+#endif
+
                  if (auto_inc_opt)
                    v->auto_inc_opt = 1;
                }