Re: [PATCH v2] Do not sanitize left shifts for -fwrapv (PR68418)

2015-12-12 Thread Eric Botcazou
> gcc: > PR sanitizer/68418 > * c-family/c-ubsan.c (ubsan_instrument_shift): Disable > sanitization of left shifts for wrapping signed types as well. That's incorrect, it should be put into c-family/ChangeLog without prefix. -- Eric Botcazou

Re: [PATCH v2] Do not sanitize left shifts for -fwrapv (PR68418)

2015-12-11 Thread Jeff Law
On 12/09/2015 10:08 AM, Paolo Bonzini wrote: Left shifts into the sign bit is a kind of overflow, and the standard chooses to treat left shifts of negative values the same way. However, the -fwrapv option modifies the language to one where integers are defined as two's complement---which also

[PATCH v2] Do not sanitize left shifts for -fwrapv (PR68418)

2015-12-09 Thread Paolo Bonzini
Left shifts into the sign bit is a kind of overflow, and the standard chooses to treat left shifts of negative values the same way. However, the -fwrapv option modifies the language to one where integers are defined as two's complement---which also defines entirely the behavior of shifts.