This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] optimize x - y cmp 0 with undefined overflow
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 27 May 2014 18:19:02 +0200
- Subject: Re: [RFC] optimize x - y cmp 0 with undefined overflow
- Authentication-results: sourceware.org; auth=none
- References: <1466969 dot VvFMuDKXoD at polaris> <53896104 dot oWY7sHq2zD at polaris> <CAFiYyc07qb6BtaGerCoojJercTnO4=b184O7km-rge=CyBjq2g at mail dot gmail dot com> <1520919 dot Q3zy2vWhEX at polaris>
On May 27, 2014 6:12:58 PM CEST, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> I'm asking to merge them (move them to fold_comparison).
>
>Done (in the end the patch removes more lines than it adds :-).
That's what I like!
>Tested on x86_64-suse-linux with no regressions.
OK.
Thanks,
Richard.
>
>2014-05-27 Eric Botcazou <ebotcazou@adacore.com>
>
> * fold-const.c (fold_comparison): Clean up and extend X +- C1 CMP C2
> to X CMP C2 -+ C1 transformation to EQ_EXPR/NE_EXPR.
> Add X - Y CMP 0 to X CMP Y transformation.
> (fold_binary_loc) <EQ_EXPR/NE_EXPR>: Remove same transformations.
>
>
>2014-05-27 Eric Botcazou <ebotcazou@adacore.com>
>
> * gcc.dg/fold-compare-8.c: New test.
> * gcc.dg/Wstrict-overflow-25.c: Likewise.