combine.c (nonzero_bits): Don't optimize away division by zero.
authorAndrew Haley <aph@cambridge.redhat.com>
Fri, 15 Jun 2001 13:27:03 +0000 (13:27 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Fri, 15 Jun 2001 13:27:03 +0000 (13:27 +0000)
2001-06-14  Andrew Haley  <aph@redhat.com>

* combine.c (nonzero_bits): Don't optimize away division by
zero.

From-SVN: r43398

gcc/ChangeLog
gcc/combine.c

index 7d106cb2d26d81b0b4e872c7ac1c4916d1490651..45c5cab27ddc16cb74da587a068dba6b2f1a273b 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-14  Andrew Haley  <aph@cambridge.redhat.com>
+
+       * combine.c (nonzero_bits): Don't optimize away division by
+       zero.
+
 2001-06-15  Zack Weinberg  <zackw@stanford.edu>
 
        * doc/cpp.texi: Revised and brought up to date.
index a9ad710b8fd193c7f3a946290e9ede91b73f1fe7..f64feca083268af238ae5ea09f1a08878d7cc004 100644 (file)
@@ -8136,18 +8136,26 @@ nonzero_bits (x, mode)
            result_low = low0 + low1;
            break;
          case DIV:
+           if (width1 == 0)
+             break;
            if (! op0_maybe_minusp && ! op1_maybe_minusp)
              result_width = width0;
            break;
          case UDIV:
+           if (width1 == 0)
+             break;
            result_width = width0;
            break;
          case MOD:
+           if (width1 == 0)
+             break;
            if (! op0_maybe_minusp && ! op1_maybe_minusp)
              result_width = MIN (width0, width1);
            result_low = MIN (low0, low1);
            break;
          case UMOD:
+           if (width1 == 0)
+             break;
            result_width = MIN (width0, width1);
            result_low = MIN (low0, low1);
            break;