Re: [PATCH][RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition

2016-06-02 Thread Kyrill Tkachov
On 02/06/16 10:08, Bernd Schmidt wrote: On 05/23/2016 01:17 PM, Kyrill Tkachov wrote: In this PR we end up hitting a signed overflow in noce_get_alt_condition when we try to increment or decrement a HOST_WIDE_INT that might be HOST_WIDE_INT_MAX or HOST_WIDE_INT_MIN. I've confirmed the overflow

Re: [PATCH][RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition

2016-06-02 Thread Bernd Schmidt
On 05/23/2016 01:17 PM, Kyrill Tkachov wrote: In this PR we end up hitting a signed overflow in noce_get_alt_condition when we try to increment or decrement a HOST_WIDE_INT that might be HOST_WIDE_INT_MAX or HOST_WIDE_INT_MIN. I've confirmed the overflow by adding an assert before the operation:

Re: [PATCH][RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition

2016-05-25 Thread Kyrill Tkachov
On 23/05/16 15:06, Richard Biener wrote: On Mon, May 23, 2016 at 3:19 PM, Kyrill Tkachov wrote: On 23/05/16 13:46, Richard Biener wrote: n Mon, May 23, 2016 at 2:28 PM, Kyrill Tkachov wrote: On 23/05/16 12:27, Richard Biener wrote: On Mon, May 23, 2016 at 1:17 PM, Kyrill Tkachov wrote: H

Re: [PATCH][RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition

2016-05-23 Thread Richard Biener
On Mon, May 23, 2016 at 3:19 PM, Kyrill Tkachov wrote: > > On 23/05/16 13:46, Richard Biener wrote: >> >> n Mon, May 23, 2016 at 2:28 PM, Kyrill Tkachov >> wrote: >>> >>> On 23/05/16 12:27, Richard Biener wrote: On Mon, May 23, 2016 at 1:17 PM, Kyrill Tkachov wrote: > > Hi

Re: [PATCH][RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition

2016-05-23 Thread Kyrill Tkachov
On 23/05/16 13:46, Richard Biener wrote: n Mon, May 23, 2016 at 2:28 PM, Kyrill Tkachov wrote: On 23/05/16 12:27, Richard Biener wrote: On Mon, May 23, 2016 at 1:17 PM, Kyrill Tkachov wrote: Hi all, In this PR we end up hitting a signed overflow in noce_get_alt_condition when we try to inc

Re: [PATCH][RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition

2016-05-23 Thread Richard Biener
n Mon, May 23, 2016 at 2:28 PM, Kyrill Tkachov wrote: > > On 23/05/16 12:27, Richard Biener wrote: >> >> On Mon, May 23, 2016 at 1:17 PM, Kyrill Tkachov >> wrote: >>> >>> Hi all, >>> >>> In this PR we end up hitting a signed overflow in noce_get_alt_condition >>> when we try to >>> increment or d

Re: [PATCH][RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition

2016-05-23 Thread Kyrill Tkachov
On 23/05/16 12:27, Richard Biener wrote: On Mon, May 23, 2016 at 1:17 PM, Kyrill Tkachov wrote: Hi all, In this PR we end up hitting a signed overflow in noce_get_alt_condition when we try to increment or decrement a HOST_WIDE_INT that might be HOST_WIDE_INT_MAX or HOST_WIDE_INT_MIN. I've co

Re: [PATCH][RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition

2016-05-23 Thread Richard Biener
On Mon, May 23, 2016 at 1:17 PM, Kyrill Tkachov wrote: > Hi all, > > In this PR we end up hitting a signed overflow in noce_get_alt_condition > when we try to > increment or decrement a HOST_WIDE_INT that might be HOST_WIDE_INT_MAX or > HOST_WIDE_INT_MIN. > > I've confirmed the overflow by adding

[PATCH][RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition

2016-05-23 Thread Kyrill Tkachov
Hi all, In this PR we end up hitting a signed overflow in noce_get_alt_condition when we try to increment or decrement a HOST_WIDE_INT that might be HOST_WIDE_INT_MAX or HOST_WIDE_INT_MIN. I've confirmed the overflow by adding an assert before the operation: gcc_assert (desired_val != HOST_WID