Re: [PATCH] Fix PR tree-optimization/71170

2016-05-24 Thread Jakub Jelinek
On Tue, May 24, 2016 at 06:46:49PM +1000, Kugan Vivekanandarajah wrote: > 2016-05-24 Kugan Vivekanandarajah > > * tree-ssa-reassoc.c (sort_by_operand_rank): Check fgimple_bb for NULL. s/fgimple/gimple/ ? > --- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-44.c > +++ b/gcc/testsuite/gcc.dg/tree-

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-24 Thread Richard Biener
On Tue, May 24, 2016 at 5:13 AM, Kugan Vivekanandarajah wrote: > On 23 May 2016 at 21:35, Richard Biener wrote: >> On Sat, May 21, 2016 at 8:08 AM, Kugan Vivekanandarajah >> wrote: >>> On 20 May 2016 at 21:07, Richard Biener wrote: On Fri, May 20, 2016 at 1:51 AM, Kugan Vivekanandarajah >>

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-24 Thread Kugan Vivekanandarajah
On 24 May 2016 at 18:36, Christophe Lyon wrote: > On 24 May 2016 at 05:13, Kugan Vivekanandarajah > wrote: >> On 23 May 2016 at 21:35, Richard Biener wrote: >>> On Sat, May 21, 2016 at 8:08 AM, Kugan Vivekanandarajah >>> wrote: On 20 May 2016 at 21:07, Richard Biener wrote: > On Fri,

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-24 Thread Christophe Lyon
On 24 May 2016 at 05:13, Kugan Vivekanandarajah wrote: > On 23 May 2016 at 21:35, Richard Biener wrote: >> On Sat, May 21, 2016 at 8:08 AM, Kugan Vivekanandarajah >> wrote: >>> On 20 May 2016 at 21:07, Richard Biener wrote: On Fri, May 20, 2016 at 1:51 AM, Kugan Vivekanandarajah wrot

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-23 Thread Kugan Vivekanandarajah
On 23 May 2016 at 21:35, Richard Biener wrote: > On Sat, May 21, 2016 at 8:08 AM, Kugan Vivekanandarajah > wrote: >> On 20 May 2016 at 21:07, Richard Biener wrote: >>> On Fri, May 20, 2016 at 1:51 AM, Kugan Vivekanandarajah >>> wrote: Hi Richard, > I think it should have the same

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-23 Thread Richard Biener
On Sat, May 21, 2016 at 8:08 AM, Kugan Vivekanandarajah wrote: > On 20 May 2016 at 21:07, Richard Biener wrote: >> On Fri, May 20, 2016 at 1:51 AM, Kugan Vivekanandarajah >> wrote: >>> Hi Richard, >>> I think it should have the same rank as op or op + 1 which is the current behavior.

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-20 Thread Kugan Vivekanandarajah
On 20 May 2016 at 21:07, Richard Biener wrote: > On Fri, May 20, 2016 at 1:51 AM, Kugan Vivekanandarajah > wrote: >> Hi Richard, >> >>> I think it should have the same rank as op or op + 1 which is the current >>> behavior. Sth else doesn't work correctly here I think, like inserting the >>> mul

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-20 Thread Richard Biener
On Fri, May 20, 2016 at 1:51 AM, Kugan Vivekanandarajah wrote: > Hi Richard, > >> I think it should have the same rank as op or op + 1 which is the current >> behavior. Sth else doesn't work correctly here I think, like inserting the >> multiplication not near the definition of op. >> >> Well, th

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Kugan Vivekanandarajah
Hi Richard, > I think it should have the same rank as op or op + 1 which is the current > behavior. Sth else doesn't work correctly here I think, like inserting the > multiplication not near the definition of op. > > Well, the whole "clever insertion" logic is simply flawed. What I meant to say

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Richard Biener
On Thu, May 19, 2016 at 2:18 PM, Kugan Vivekanandarajah wrote: > On 19 May 2016 at 18:55, Richard Biener wrote: >> On Thu, May 19, 2016 at 10:26 AM, Kugan >> wrote: >>> Hi, >>> >>> >>> On 19/05/16 18:21, Richard Biener wrote: On Thu, May 19, 2016 at 10:12 AM, Kugan Vivekanandarajah wr

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Kugan Vivekanandarajah
On 19 May 2016 at 18:55, Richard Biener wrote: > On Thu, May 19, 2016 at 10:26 AM, Kugan > wrote: >> Hi, >> >> >> On 19/05/16 18:21, Richard Biener wrote: >>> On Thu, May 19, 2016 at 10:12 AM, Kugan Vivekanandarajah >>> wrote: Hi Martin, Thanks for the fix. Just to elaborate (as m

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Richard Biener
On Thu, May 19, 2016 at 10:26 AM, Kugan wrote: > Hi, > > > On 19/05/16 18:21, Richard Biener wrote: >> On Thu, May 19, 2016 at 10:12 AM, Kugan Vivekanandarajah >> wrote: >>> Hi Martin, >>> >>> Thanks for the fix. Just to elaborate (as mentioned in PR) >>> >>> At tree-ssa-reassoc.c:3897, we have:

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Kugan
Hi, On 19/05/16 18:21, Richard Biener wrote: > On Thu, May 19, 2016 at 10:12 AM, Kugan Vivekanandarajah > wrote: >> Hi Martin, >> >> Thanks for the fix. Just to elaborate (as mentioned in PR) >> >> At tree-ssa-reassoc.c:3897, we have: >> >> stmt: >> _15 = _4 + c_7(D); >> >> oe->op def_stmt: >> _

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Richard Biener
On Thu, May 19, 2016 at 10:12 AM, Kugan Vivekanandarajah wrote: > Hi Martin, > > Thanks for the fix. Just to elaborate (as mentioned in PR) > > At tree-ssa-reassoc.c:3897, we have: > > stmt: > _15 = _4 + c_7(D); > > oe->op def_stmt: > _17 = c_7(D) * 3; > > > : > a1_6 = s_5(D) * 2; > _1 = (long int

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Kugan Vivekanandarajah
Hi Martin, Thanks for the fix. Just to elaborate (as mentioned in PR) At tree-ssa-reassoc.c:3897, we have: stmt: _15 = _4 + c_7(D); oe->op def_stmt: _17 = c_7(D) * 3; : a1_6 = s_5(D) * 2; _1 = (long int) a1_6; x1_8 = _1 + c_7(D); a2_9 = s_5(D) * 4; _2 = (long int) a2_9; a3_11 = s_5(D) * 6; _3

Re: [PATCH] Fix PR tree-optimization/71170

2016-05-19 Thread Richard Biener
On Thu, May 19, 2016 at 10:04 AM, Martin Liška wrote: > Hello. > > Following patch fixes the ICE as it defensively finds the right > place where a new STMT should be inserted. > > Patch bootstraps on x86_64-linux-gnu and no new regression is introduced. > > Ready for trunk? @@ -3813,7 +3813,8 @@