This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fold X/C1 < C2 also for EXACT_DIV_EXPR
- From: Roger Sayle <roger at eyesopen dot com>
- To: Falk Hueffner <falk at debian dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 9 Jan 2005 11:08:27 -0700 (MST)
- Subject: Re: [PATCH] Fold X/C1 < C2 also for EXACT_DIV_EXPR
On Sun, 9 Jan 2005, Falk Hueffner wrote:
> 2005-01-08 Falk Hueffner <falk@debian.org>
>
> * fold-const.c (fold): Also handle EXACT_DIV_EXPR when folding
> X/C1 cmpop C2.
>
This is OK for mainline.
In theory, we could do a bit better for EXACT_DIV_EXPR, i.e. X/C1 == C2
can be optimized to "X == C1*C2" for EXACT_DIV_EXPR, but requires a range
test for TRUNC_DIV_EXPR. But this would require tweaking fold_div_compare
which I'm not sure would be suitable during stage3.
Thanks,
Roger
--