fold-const.c (fold_div_compare): New function to optimize X/C1 op C2 where op is...
authorRoger Sayle <roger@eyesopen.com>
Sat, 8 May 2004 17:36:21 +0000 (17:36 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sat, 8 May 2004 17:36:21 +0000 (17:36 +0000)
commit8dc2384cc96eeab306f1267118a194a50eb37953
treeed0f064da7a01d71c6b87b252c9b06aeea96bed9
parentae81c844737f88dbe4420faca7fdebcbfb80861f
fold-const.c (fold_div_compare): New function to optimize X/C1 op C2 where op is a comparison operator and C1...

* fold-const.c (fold_div_compare): New function to optimize X/C1 op C2
where op is a comparison operator and C1 and C2 are integer constants
into a range check.
(fold): Call fold_div_compare.

* gcc.c-torture/execute/divcmp-1.c: New test case.
* gcc.c-torture/execute/divcmp-2.c: New test case.
* gcc.c-torture/execute/divcmp-3.c: New test case.

From-SVN: r81645
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/divcmp-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/divcmp-2.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/divcmp-3.c [new file with mode: 0644]