Re: [PATCH] Fix various undefined behaviors in gcc found by bootstrap-ubsan

2014-07-02 Thread Jeff Law
On 07/02/14 02:14, Jakub Jelinek wrote: Hi! Most of this probably doesn't need explanation, just the expand_sdiv_pow2 change - shift_cost only tracks shift counts to MAX_BITS_PER_WORD (but, for consistency between e.g. i?86 and x86_64 -m32 we'd better use BITS_PER_WORD instead as in most other e

Re: [PATCH] Fix various undefined behaviors in gcc found by bootstrap-ubsan

2014-07-02 Thread Mike Stump
On Jul 2, 2014, at 1:14 AM, Jakub Jelinek wrote: > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? wide-int part, Ok. > * wide-int-print.cc (print_decs): Negate UHWI instead of HWI. > --- gcc/wide-int-print.cc.jj 2014-05-11 22:21:04.0 +0200 > +++ gcc/wide-int

[PATCH] Fix various undefined behaviors in gcc found by bootstrap-ubsan

2014-07-02 Thread Jakub Jelinek
Hi! Most of this probably doesn't need explanation, just the expand_sdiv_pow2 change - shift_cost only tracks shift counts to MAX_BITS_PER_WORD (but, for consistency between e.g. i?86 and x86_64 -m32 we'd better use BITS_PER_WORD instead as in most other expmed.c places), when called with larger v