Re: More type narrowing in match.pd

2015-05-01 Thread Jeff Law
On 04/30/2015 05:07 AM, Richard Biener wrote: On Thu, Apr 30, 2015 at 12:53 PM, Marc Glisse wrote: On Thu, 30 Apr 2015, Richard Biener wrote: I have in my local dev tree (so completely untested...) @@ -1040,31 +1052,22 @@ (define_operator_list CBRT BUILT_IN_CBRT operation and convert the

Re: More type narrowing in match.pd

2015-05-01 Thread Jeff Law
On 04/30/2015 03:38 PM, Marc Glisse wrote: On Thu, 30 Apr 2015, Jeff Law wrote: On 04/30/2015 01:17 AM, Marc Glisse wrote: +/* This is another case of narrowing, specifically when there's an outer + BIT_AND_EXPR which masks off bits outside the type of the innermost + operands. Like the

Re: More type narrowing in match.pd

2015-04-30 Thread Marc Glisse
On Thu, 30 Apr 2015, Jeff Law wrote: On 04/30/2015 01:17 AM, Marc Glisse wrote: +/* This is another case of narrowing, specifically when there's an outer + BIT_AND_EXPR which masks off bits outside the type of the innermost + operands. Like the previous case we have to convert the operan

Re: More type narrowing in match.pd

2015-04-30 Thread Jeff Law
On 04/30/2015 01:17 AM, Marc Glisse wrote: +/* This is another case of narrowing, specifically when there's an outer + BIT_AND_EXPR which masks off bits outside the type of the innermost + operands. Like the previous case we have to convert the operands + to unsigned types to avoid intro

Re: More type narrowing in match.pd

2015-04-30 Thread Jeff Law
On 04/30/2015 03:00 AM, Richard Biener wrote: Without looking too close at this patch I'll note that we might want to improve the previous one first to also handle a constant 2nd operand for the operation (your new one also misses that). Yea, I think you mentioned in that in the 47477 BZ as well

Re: More type narrowing in match.pd

2015-04-30 Thread Richard Biener
On Thu, Apr 30, 2015 at 12:53 PM, Marc Glisse wrote: > On Thu, 30 Apr 2015, Richard Biener wrote: > >> I have in my local dev tree (so completely untested...) >> >> @@ -1040,31 +1052,22 @@ (define_operator_list CBRT BUILT_IN_CBRT >>operation and convert the result to the desired type. */ >> (

Re: More type narrowing in match.pd

2015-04-30 Thread Marc Glisse
On Thu, 30 Apr 2015, Richard Biener wrote: I have in my local dev tree (so completely untested...) @@ -1040,31 +1052,22 @@ (define_operator_list CBRT BUILT_IN_CBRT operation and convert the result to the desired type. */ (for op (plus minus) (simplify -(convert (op (convert@2 @0) (con

Re: More type narrowing in match.pd

2015-04-30 Thread Richard Biener
On Thu, Apr 30, 2015 at 5:52 AM, Jeff Law wrote: > > This is an incremental improvement to the type narrowing in match.pd. It's > largely based on the pattern I added to fix 47477. > > Basically if we have > > (bit_and (arith_op (convert A) (convert B)) mask) > > Where the conversions are widening

Re: More type narrowing in match.pd

2015-04-30 Thread Marc Glisse
On Wed, 29 Apr 2015, Jeff Law wrote: This is an incremental improvement to the type narrowing in match.pd. It's largely based on the pattern I added to fix 47477. Basically if we have (bit_and (arith_op (convert A) (convert B)) mask) Where the conversions are widening and the mask turns off