From 2a8bb5cfe688fabfd8b957e355b563cfd2e84f5c Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Fri, 15 Jun 2001 13:27:03 +0000 Subject: [PATCH] combine.c (nonzero_bits): Don't optimize away division by zero. 2001-06-14 Andrew Haley * combine.c (nonzero_bits): Don't optimize away division by zero. From-SVN: r43398 --- gcc/ChangeLog | 5 +++++ gcc/combine.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7d106cb2d26..45c5cab27dd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-06-14 Andrew Haley + + * combine.c (nonzero_bits): Don't optimize away division by + zero. + 2001-06-15 Zack Weinberg * doc/cpp.texi: Revised and brought up to date. diff --git a/gcc/combine.c b/gcc/combine.c index a9ad710b8fd..f64feca0832 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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; -- 2.30.2