This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [4.2] Make fold, fold (type) (a CMP b) into a CMP bfor integral types
- From: Jeffrey A Law <law at redhat dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: patch Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 08 Sep 2005 08:39:40 -0600
- Subject: Re: [PATCH] [4.2] Make fold, fold (type) (a CMP b) into a CMP bfor integral types
- References: <fad4aa5bab97c2d46fcebc666f740d3b@physics.uc.edu>
- Reply-to: law at redhat dot com
On Mon, 2005-08-29 at 00:23 -0400, Andrew Pinski wrote:
> I noticed while working on my tree combiner, that fold does not fold
> "(integral_type) (a CMP b)" to "a CMP b" with the integral_type as the
> resulting comparison's type. This improves the amount of simplifications
> the tree combiner can do and actually improves the likely-hood that the
> tree combiner replaces forwprop pass fully. Also this is already in
> convert, convert just has too many places where it does fold's job; this
> is just one example. Should I also remove the code from convert?
>
> OK for 4.2? Bootstrapped and tested on x86_64-linux-gnu with no
> regressions.
>
> Thanks,
> Andrew Pinski
>
> ChangeLog:
>
> * fold-const.c (fold_unary) <case NOP_EXPR, CONVERT_EXPR>: For
> COMPARISON_CLASS_P and an integral types create create a new
> expression with the new type and fold that.
The corrected version (which you posted soon after this one) is OK
once we've created the 4.1 branch. You should probably attach this
patch to the list of 4.2 pending patches.
Jeff