Re: [PATCH] Fix ubsan expansion (PR sanitizer/60613)

2014-03-22 Thread Richard Biener
On March 21, 2014 9:32:54 PM CET, Jakub Jelinek wrote: >Hi! > >As MINUS_EXPR is not commutative, we really can't swap op0 with op1 >for testing whether subtraction overflowed, that is only possible for >PLUS_EXPR, for MINUS_EXPR we really have to know if op1 is constant >or negative or non-negativ

[PATCH] Fix ubsan expansion (PR sanitizer/60613)

2014-03-21 Thread Jakub Jelinek
Hi! As MINUS_EXPR is not commutative, we really can't swap op0 with op1 for testing whether subtraction overflowed, that is only possible for PLUS_EXPR, for MINUS_EXPR we really have to know if op1 is constant or negative or non-negative and have to compare result with op0 depending on that. Boot