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

2001-06-14  Andrew Haley  <aph@redhat.com>

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

From-SVN: r43398
This commit is contained in:
Andrew Haley 2001-06-15 13:27:03 +00:00 committed by Andrew Haley
parent 50622d8b6c
commit 2a8bb5cfe6
2 changed files with 13 additions and 0 deletions

View 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.

View 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;