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: Yuri Gribov <tetra2005 at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, 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: Fri, 28 Jul 2017 04:15:52 +0100
- Subject: Re: [PATCHv4][PING][PR 57371] Remove useless floating point casts in comparisons
- Authentication-results: sourceware.org; auth=none
- References: <CAJOtW+6ex6pN=hpe02Z8BRDZA_CTzyYxNjQ18ASgJmJxroz9bQ@mail.gmail.com> <CAFiYyc1YKny=rL_aHy4SWcsxqTARALaaz8ROtCSgJ6FhgNE5fw@mail.gmail.com> <3781f340-8565-8c5a-0175-93f3818ee424@redhat.com>
On Tue, Jul 25, 2017 at 9:32 PM, Jeff Law <law@redhat.com> wrote:
> 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.
I was initially scared to rely on particular semantics of
verify_gimple_assign_unary so left the assert in place, especially
given that it puzzled others as well. I'll remove it.
-Y