Re: [PATCH] Fix divmod expansion (PR middle-end/78416, take 2)

2016-11-22 Thread Richard Biener
On Mon, Nov 21, 2016 at 8:09 PM, Jakub Jelinek wrote: > Hi! > > On Fri, Nov 18, 2016 at 11:10:58PM +0100, Richard Biener wrote: >> I wonder if transforming the const-int to wide int makes this all easier to >> read? > > Here is updated patch that does that. >

[PATCH] Fix divmod expansion (PR middle-end/78416, take 2)

2016-11-21 Thread Jakub Jelinek
Hi! On Fri, Nov 18, 2016 at 11:10:58PM +0100, Richard Biener wrote: > I wonder if transforming the const-int to wide int makes this all easier to > read? Here is updated patch that does that. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2016-11-21 Jakub Jelinek

Re: [PATCH] Fix divmod expansion (PR middle-end/78416)

2016-11-18 Thread Richard Biener
On November 18, 2016 10:45:10 PM GMT+01:00, Jakub Jelinek wrote: >Hi! > >As the testcase shows, expand_divmod doesn't handle properly >division/remainder in modes larger than HOST_BITS_PER_WIDE_INT like >TImode - if op1 is "negative" CONST_INT, it means it has 65 most

[PATCH] Fix divmod expansion (PR middle-end/78416)

2016-11-18 Thread Jakub Jelinek
Hi! As the testcase shows, expand_divmod doesn't handle properly division/remainder in modes larger than HOST_BITS_PER_WIDE_INT like TImode - if op1 is "negative" CONST_INT, it means it has 65 most significant bits set, but EXACT_POWER_OF_2_OR_ZERO_P will happily return true on that and optimize