[PATCH 4/4] Fix scaling of a sreal number.
marxin
mliska@suse.cz
Mon Sep 24 07:37:00 GMT 2018
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.
---
gcc/ipa-fnsummary.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Fix-scaling-of-a-sreal-number.patch
Type: text/x-patch
Size: 677 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180924/6e0dd2c8/attachment.bin>
More information about the Gcc-patches
mailing list