[PATCH] Fix ICE in ipa-cp due to cost addition overflow (PR 96806)

Feng Xue OS fxue@os.amperecomputing.com
Mon Aug 31 08:05:51 GMT 2020


This patch is to fix a bug that cost that is used to evaluate clone candidate
becomes negative due to integer overflow.

Feng
---
2020-08-31  Feng Xue  <fxue@os.amperecomputing.com>

gcc/
        PR tree-optimization/96806
        * ipa-cp.c (decide_about_value): Use safe_add to avoid cost addition
        overflow.

gcc/testsuite/
        PR tree-optimization/96806
        * g++.dg/ipa/pr96806.C: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ipa-96806-Fix-ICE-in-ipa-cp-due-to-integer-addition-.patch
Type: text/x-patch
Size: 2845 bytes
Desc: 0001-ipa-96806-Fix-ICE-in-ipa-cp-due-to-integer-addition-.patch
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200831/c7355449/attachment.bin>


More information about the Gcc-patches mailing list