[PATCH 4/4] Fix scaling of a sreal number.

Jeff Law law@redhat.com
Mon Sep 24 14:42:00 GMT 2018


On 9/23/18 1:08 AM, marxin wrote:
> 
> The patch is addressing following LLVM warning:
> gcc/ipa-fnsummary.c:2745:54:Value Conversion Issue: implicit conversion from 'double' to 'int64_t' (aka 'long') changes value from 0.99 to 0: -Wliteral-conversion
> 
> Taking look at GIMPLE IR we end up with:
> 
>   <bb 45> :
>   D.107433 ={v} {CLOBBER};
>   sreal::sreal (&D.107437, -1, 0);
>   sreal::sreal (&D.107434, 0, 0);
>   D.107435 = sreal::operator* (&time, &D.107434);
>   D.107436 = sreal::operator- (&nonspecialized_time, &D.107435);
>   _65 = operator>= (&D.107436, &D.107437);
>   _66 = ~_65;
>   if (_66 != 0)
>     goto <bb 46>; [INV]
>   else
>     goto <bb 47>; [INV]
> 
>   <bb 46> :
>   fancy_abort ("/home/marxin/Programming/gcc/gcc/ipa-fnsummary.c", 2745, &__FUNCTION__);
> 
> which confirms the warning.
> 
> gcc/ChangeLog:
> 
> 2018-09-23  Martin Liska  <mliska@suse.cz>
> 
> 	* ipa-fnsummary.c (estimate_node_size_and_time): Scale by two
> 	integers and not by a float value.
OK.
jeff



More information about the Gcc-patches mailing list