This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCHv4][PING][PR 57371] Remove useless floating point casts in comparisons
- From: Jeff Law <law at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>, Yuri Gribov <tetra2005 at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Marc Glisse <marc dot glisse at inria dot fr>, Joseph Myers <joseph at codesourcery dot com>
- Date: Tue, 25 Jul 2017 14:32:48 -0600
- Subject: Re: [PATCHv4][PING][PR 57371] Remove useless floating point casts in comparisons
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=law at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 60F7CA0B57
- References: <CAJOtW+6ex6pN=hpe02Z8BRDZA_CTzyYxNjQ18ASgJmJxroz9bQ@mail.gmail.com> <CAFiYyc1YKny=rL_aHy4SWcsxqTARALaaz8ROtCSgJ6FhgNE5fw@mail.gmail.com>
On 07/25/2017 08:10 AM, Richard Biener wrote:
> On Mon, Jul 17, 2017 at 9:29 AM, Yuri Gribov <tetra2005@gmail.com> wrote:
>> Hi all,
>>
>> This is an updated version of patch in
>> https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00409.html . It prevents
>> optimization in presense of sNaNs (and qNaNs when comparison operator
>> is > >= < <=) to preserve FP exceptions.
>>
>> Note that I had to use -fsignaling-nans in pr57371-5.c test because by
>> default this option is off and some existing patterns in match.pd
>> happily optimize NaN comparisons, even with sNaNs (!).
>>
>> Bootstrapped and regtested on x64. Ok for trunk?
>
> + {
> + tree itype = TREE_TYPE (@0);
> + gcc_assert (INTEGRAL_TYPE_P (itype));
>
> no need to spell out this assert.
Right. I think Yuri added this in response to a comment from me.
However, I think the subsequent discussion made it clear that we don't
actually need to check that @0 is an integral type.
Jeff