Re: shift/extract SHIFT_COUNT_TRUNCATED combine bug

2015-01-14 Thread Segher Boessenkool
On Wed, Jan 14, 2015 at 10:10:24AM +0100, Richard Biener wrote: > On Tue, Jan 13, 2015 at 6:38 PM, Segher Boessenkool > wrote: > > On Tue, Jan 13, 2015 at 10:51:27AM +0100, Richard Biener wrote: > >> IMHO SHIFT_COUNT_TRUNCATED should be removed and instead > >> backends should provide shift patter

Re: shift/extract SHIFT_COUNT_TRUNCATED combine bug

2015-01-14 Thread Richard Biener
On Tue, Jan 13, 2015 at 6:38 PM, Segher Boessenkool wrote: > On Tue, Jan 13, 2015 at 10:51:27AM +0100, Richard Biener wrote: >> IMHO SHIFT_COUNT_TRUNCATED should be removed and instead >> backends should provide shift patterns with a (and:QI ...) for the >> shift amount which simply will omit that

Re: shift/extract SHIFT_COUNT_TRUNCATED combine bug

2015-01-13 Thread Segher Boessenkool
On Tue, Jan 13, 2015 at 10:51:27AM +0100, Richard Biener wrote: > IMHO SHIFT_COUNT_TRUNCATED should be removed and instead > backends should provide shift patterns with a (and:QI ...) for the > shift amount which simply will omit that operation if suitable. Note that that catches less though, e.g.

Re: shift/extract SHIFT_COUNT_TRUNCATED combine bug

2015-01-13 Thread Jeff Law
On 01/13/15 02:51, Richard Biener wrote: On a SHIFT_COUNT_TRUNCATED target, I don't think it's ever OK to widen a shift, variable or constant. In the case of a variable shift, we could easily have eliminated the masking code before or during combine. For a constant shift amount we could have ad

Re: shift/extract SHIFT_COUNT_TRUNCATED combine bug

2015-01-13 Thread Richard Biener
On Mon, Jan 12, 2015 at 11:12 PM, Jeff Law wrote: > On 04/08/14 14:07, Mike Stump wrote: >> >> Something broke in the compiler to cause combine to incorrectly optimize: >> >> (insn 12 11 13 3 (set (reg:SI 604 [ D.6102 ]) >> (lshiftrt:SI (subreg/s/u:SI (reg/v:DI 601 [ x ]) 0) >>

Re: shift/extract SHIFT_COUNT_TRUNCATED combine bug

2015-01-12 Thread Jeff Law
On 04/08/14 14:07, Mike Stump wrote: Something broke in the compiler to cause combine to incorrectly optimize: (insn 12 11 13 3 (set (reg:SI 604 [ D.6102 ]) (lshiftrt:SI (subreg/s/u:SI (reg/v:DI 601 [ x ]) 0) (reg:SI 602 [ D.6103 ]))) t.c:47 4436 {lshrsi3} (expr_list:

shift/extract SHIFT_COUNT_TRUNCATED combine bug

2014-04-08 Thread Mike Stump
Something broke in the compiler to cause combine to incorrectly optimize: (insn 12 11 13 3 (set (reg:SI 604 [ D.6102 ]) (lshiftrt:SI (subreg/s/u:SI (reg/v:DI 601 [ x ]) 0) (reg:SI 602 [ D.6103 ]))) t.c:47 4436 {lshrsi3} (expr_list:REG_DEAD (reg:SI 602 [ D.6103 ]) (