This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCHv4][PING][PR 57371] Remove useless floating point casts in comparisons


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]