]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix UB in int_const_binop
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Apr 2019 12:30:36 +0000 (12:30 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Apr 2019 12:30:36 +0000 (12:30 +0000)
commit7a7f383749e416df335444fdbe5c0dfcfc918008
treebe03f26d6f967997c007886d0080a9d364a3f1e2
parentece3beac40ee149d606f968bd7eee1a62f279d56
Fix UB in int_const_binop

When testing PR 85164, the baseline bootstrap-ubsan results had
a lot of failures from int_const_binop.  This is because with the
new overflow handling we can sometimes do:

      poly_res = res;

on an uninitialised res.

2019-04-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* fold-const.c (int_const_binop): Return early on failure.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270443 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const.c