Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-09 Thread Richard Biener
On Thu, 9 Jan 2014, Jakub Jelinek wrote: > On Thu, Jan 09, 2014 at 02:13:39PM +0100, Richard Biener wrote: > > On Thu, 9 Jan 2014, Jakub Jelinek wrote: > > > > > On Thu, Jan 09, 2014 at 01:30:53PM +0100, Richard Biener wrote: > > > > > gimplify_modify_expr has: > > > > > > > > > > if (!gim

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-09 Thread Jakub Jelinek
On Thu, Jan 09, 2014 at 02:13:39PM +0100, Richard Biener wrote: > On Thu, 9 Jan 2014, Jakub Jelinek wrote: > > > On Thu, Jan 09, 2014 at 01:30:53PM +0100, Richard Biener wrote: > > > > gimplify_modify_expr has: > > > > > > > > if (!gimple_call_noreturn_p (assign)) > > > > gimple_cal

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-09 Thread Richard Biener
On Thu, 9 Jan 2014, Jakub Jelinek wrote: > On Thu, Jan 09, 2014 at 01:30:53PM +0100, Richard Biener wrote: > > > gimplify_modify_expr has: > > > > > > if (!gimple_call_noreturn_p (assign)) > > > gimple_call_set_lhs (assign, *to_p); > > > > Ok, it seems to be too early then - move i

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-09 Thread Jakub Jelinek
On Thu, Jan 09, 2014 at 01:30:53PM +0100, Richard Biener wrote: > > gimplify_modify_expr has: > > > > if (!gimple_call_noreturn_p (assign)) > > gimple_call_set_lhs (assign, *to_p); > > Ok, it seems to be too early then - move it after the folding. That wouldn't help all the other e

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-09 Thread Richard Biener
On Thu, 9 Jan 2014, Jakub Jelinek wrote: > On Thu, Jan 09, 2014 at 12:31:47PM +0100, Richard Biener wrote: > > On Thu, 9 Jan 2014, Jakub Jelinek wrote: > > > > > On Thu, Jan 09, 2014 at 12:15:00PM +0100, Richard Biener wrote: > > > > > Well, then the __cxa_pure_virtual testcases ICE again, but th

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-09 Thread Jakub Jelinek
On Thu, Jan 09, 2014 at 12:31:47PM +0100, Richard Biener wrote: > On Thu, 9 Jan 2014, Jakub Jelinek wrote: > > > On Thu, Jan 09, 2014 at 12:15:00PM +0100, Richard Biener wrote: > > > > Well, then the __cxa_pure_virtual testcases ICE again, but the > > > > pr59622-5.C > > > > testcase ICEs anyway,

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-09 Thread Richard Biener
On Thu, 9 Jan 2014, Jakub Jelinek wrote: > On Thu, Jan 09, 2014 at 12:15:00PM +0100, Richard Biener wrote: > > > Well, then the __cxa_pure_virtual testcases ICE again, but the pr59622-5.C > > > testcase ICEs anyway, so here is a different patch (untested so far except > > > for the tests). The is

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-09 Thread Jakub Jelinek
On Thu, Jan 09, 2014 at 12:15:00PM +0100, Richard Biener wrote: > > Well, then the __cxa_pure_virtual testcases ICE again, but the pr59622-5.C > > testcase ICEs anyway, so here is a different patch (untested so far except > > for the tests). The issue with the calls is that when fold_stmt is done

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-09 Thread Richard Biener
On Thu, 9 Jan 2014, Jakub Jelinek wrote: > On Thu, Jan 09, 2014 at 09:46:11AM +0100, Richard Biener wrote: > > > + /* If fndecl (like __builtin_unreachable or > > > + __cxa_pure_virtual) takes no arguments, doesn't have > > > + return value and is noreturn, if the call does

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-09 Thread Jakub Jelinek
On Thu, Jan 09, 2014 at 09:46:11AM +0100, Richard Biener wrote: > > + /* If fndecl (like __builtin_unreachable or > > +__cxa_pure_virtual) takes no arguments, doesn't have > > +return value and is noreturn, if the call doesn't have > > +lhs or lhs isn't S

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-09 Thread Richard Biener
On Wed, 8 Jan 2014, Jakub Jelinek wrote: > On Wed, Jan 08, 2014 at 12:19:02PM +0100, Richard Biener wrote: > > On Wed, 8 Jan 2014, Jakub Jelinek wrote: > > > > > On Wed, Jan 08, 2014 at 12:15:40PM +0100, Richard Biener wrote: > > > > > I start to think this is a too complex transform for stmt fol

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-08 Thread Jakub Jelinek
On Wed, Jan 08, 2014 at 12:19:02PM +0100, Richard Biener wrote: > On Wed, 8 Jan 2014, Jakub Jelinek wrote: > > > On Wed, Jan 08, 2014 at 12:15:40PM +0100, Richard Biener wrote: > > > > I start to think this is a too complex transform for stmt folding ... > > > > > > Alternatively do update_call_f

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-08 Thread Richard Biener
On Wed, 8 Jan 2014, Jakub Jelinek wrote: > On Wed, Jan 08, 2014 at 12:15:40PM +0100, Richard Biener wrote: > > > I start to think this is a too complex transform for stmt folding ... > > > > Alternatively do update_call_from_tree (gsi, get_or_create_ssa_default_def > > (cfun, create_tmp_var (TRE

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-08 Thread Jakub Jelinek
On Wed, Jan 08, 2014 at 12:15:40PM +0100, Richard Biener wrote: > > I start to think this is a too complex transform for stmt folding ... > > Alternatively do update_call_from_tree (gsi, get_or_create_ssa_default_def > (cfun, create_tmp_var (TREE_TYPE (lhs. The lhs might not be is_gimple_reg

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-08 Thread Richard Biener
On Wed, 8 Jan 2014, Richard Biener wrote: > On Wed, 8 Jan 2014, Jakub Jelinek wrote: > > > On Wed, Jan 08, 2014 at 11:45:28AM +0100, Richard Biener wrote: > > > I prefer to always do this, not do the fancy insertion-before. That > > > would do repeated folding for > > > > > >fold_stmt (gsi)

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-08 Thread Richard Biener
On Wed, 8 Jan 2014, Jakub Jelinek wrote: > On Wed, Jan 08, 2014 at 11:45:28AM +0100, Richard Biener wrote: > > I prefer to always do this, not do the fancy insertion-before. That > > would do repeated folding for > > > >fold_stmt (gsi); > >fold_stmt (gsi); > >fold_stmt (gsi); > > >

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-08 Thread Jakub Jelinek
On Wed, Jan 08, 2014 at 11:45:28AM +0100, Richard Biener wrote: > I prefer to always do this, not do the fancy insertion-before. That > would do repeated folding for > >fold_stmt (gsi); >fold_stmt (gsi); >fold_stmt (gsi); > > where the last two should be a no-op. I don't see how is

Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-08 Thread Richard Biener
On Tue, 7 Jan 2014, Jakub Jelinek wrote: > Hi! > > On Fri, Jan 03, 2014 at 11:33:50AM +0100, Jakub Jelinek wrote: > > On Fri, Jan 03, 2014 at 11:24:53AM +0100, Richard Biener wrote: > > Anyway, back to the original patch, so do you prefer something like > this instead? I.e. handle only __builti

[PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 3)

2014-01-07 Thread Jakub Jelinek
Hi! On Fri, Jan 03, 2014 at 11:33:50AM +0100, Jakub Jelinek wrote: > On Fri, Jan 03, 2014 at 11:24:53AM +0100, Richard Biener wrote: Anyway, back to the original patch, so do you prefer something like this instead? I.e. handle only __builtin_unreachable and __cxa_pure_virtual specially, and not