https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88234
--- Comment #12 from Jeffrey Walton <noloader at gmail dot com> --- (In reply to Jakub Jelinek from comment #10) > Author: jakub > Date: Thu Nov 29 14:23:21 2018 > New Revision: 266619 > > URL: https://gcc.gnu.org/viewcvs?rev=266619&root=gcc&view=rev > Log: > 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. > ... In case it is useful, here are some additional datapoints from the exyernal bug report. It could help provide a little more coverage for the test case. signed integer overflow: 127 + 1 cannot be represented in type 'signed char' signed integer overflow: 7640891576939301132 + 5840696475078001361 cannot be represented in type 'long int' signed integer overflow: -4942790177534073029 + -7262195936335986787 cannot be represented in type 'long int' signed integer overflow: 6625583534739731862 + 7088136013498015297 cannot be represented in type 'long int' signed integer overflow: -5587509538033248007 + -3814479935187347353 cannot be represented in type 'long int' p