re PR target/88234 (UBsan and runtime error: signed integer overflow using unsigned...
authorJakub Jelinek <jakub@redhat.com>
Thu, 29 Nov 2018 14:23:21 +0000 (15:23 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 29 Nov 2018 14:23:21 +0000 (15:23 +0100)
commitb076fecbc240380b25bb25c65aae85c4b5ea9ce5
tree9c95b0ce844161a5d2b42f74d6c575c8b751b76a
parent55da34ebc20f2515c06e46612545f940eb2d0fb0
re PR target/88234 (UBsan and runtime error: signed integer overflow using unsigned vector)

PR target/88234
* config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): For
vec_add and vec_sub builtins, perform PLUS_EXPR or MINUS_EXPR
in unsigned_type_for instead of vector integral type where overflow
doesn't wrap.

* gcc.dg/ubsan/pr88234.c: New test.

From-SVN: r266619
gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ubsan/pr88234.c [new file with mode: 0644]