Re: [PATCH] Fix UB in tree-ssa-structalias.c

2017-06-19 Thread Richard Biener
On June 19, 2017 7:46:03 PM GMT+02:00, Jakub Jelinek wrote: >Hi! > >Another easy to fix bug reported by bootstrap-ubsan. >We check that rhsunitoffset fits into shwi, but even if it does, >8x that might not, in which case we trigger UB. >Fixed by doing the multiplication in unsigned HWI type to mak

[PATCH] Fix UB in tree-ssa-structalias.c

2017-06-19 Thread Jakub Jelinek
Hi! Another easy to fix bug reported by bootstrap-ubsan. We check that rhsunitoffset fits into shwi, but even if it does, 8x that might not, in which case we trigger UB. Fixed by doing the multiplication in unsigned HWI type to make it well defined. Bootstrapped/regtested on x86_64-linux and i686