Re: [Bug tree-optimization] Fix for PR71994

2016-07-27 Thread Jeff Law
On 07/26/2016 06:10 PM, kugan wrote: Hi Jeff, Thanks for your comments. * tree-ssa-reassoc.c (maybe_optimize_range_tests): Check type compatibility. I'd kind of like to see some analysis of how we've got a bool here -- ISTM it ought to have been converted it to the type of the LHS

Re: [Bug tree-optimization] Fix for PR71994

2016-07-26 Thread kugan
Hi Jeff, Thanks for your comments. * tree-ssa-reassoc.c (maybe_optimize_range_tests): Check type compatibility. I'd kind of like to see some analysis of how we've got a bool here -- ISTM it ought to have been converted it to the type of the LHS of the PHI when propagated. You are

Re: [Bug tree-optimization] Fix for PR71994

2016-07-26 Thread Jeff Law
On 07/25/2016 09:13 PM, kugan wrote: Hi, For testcase in pr71994, type of bb conditional result and the type of the PHI stmt are different (as om.0_1 is int and the first PHI argument is _bool; PHI stmt uses a constant zero that comes from edge 2). Therefore when we optimize final range test

Re: [Bug tree-optimization] Fix for PR71994

2016-07-26 Thread Richard Biener
On Tue, Jul 26, 2016 at 2:34 PM, kugan wrote: > Hi Richard, > > > On 26/07/16 21:48, Richard Biener wrote: >> >> On Tue, Jul 26, 2016 at 5:13 AM, kugan >> wrote: >>> >>> Hi, >>> >>> For testcase in pr71994, type of bb

Re: [Bug tree-optimization] Fix for PR71994

2016-07-26 Thread kugan
Hi Richard, On 26/07/16 21:48, Richard Biener wrote: On Tue, Jul 26, 2016 at 5:13 AM, kugan wrote: Hi, For testcase in pr71994, type of bb conditional result and the type of the PHI stmt are different (as om.0_1 is int and the first PHI argument is _bool;

Re: [Bug tree-optimization] Fix for PR71994

2016-07-26 Thread Richard Biener
On Tue, Jul 26, 2016 at 5:13 AM, kugan wrote: > Hi, > > For testcase in pr71994, type of bb conditional result and the type of the > PHI stmt are different (as om.0_1 is int and the first PHI argument is > _bool; PHI stmt uses a constant zero that comes from

[Bug tree-optimization] Fix for PR71994

2016-07-25 Thread kugan
Hi, For testcase in pr71994, type of bb conditional result and the type of the PHI stmt are different (as om.0_1 is int and the first PHI argument is _bool; PHI stmt uses a constant zero that comes from edge 2). Therefore when we optimize final range test stmt, we end up setting integer 1