[Bug rtl-optimization/86928] ICE in compute_live, at sel-sched.c:3097

2019-04-03 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86928

--- Comment #6 from Segher Boessenkool  ---
(In reply to Alexander Monakov from comment #5)
> I didn't have any better ideas, so fixed via comment #2.

Thanks!

[Bug rtl-optimization/86928] ICE in compute_live, at sel-sched.c:3097

2019-04-02 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86928
Bug 86928 depends on bug 89916, which changed state.

Bug 89916 Summary: New test case gcc.dg/pr86928.c fails on 64 bit targets 
(r270061)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89916

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug rtl-optimization/86928] ICE in compute_live, at sel-sched.c:3097

2019-04-01 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86928

Alexander Monakov  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Alexander Monakov  ---
I didn't have any better ideas, so fixed via comment #2.

[Bug rtl-optimization/86928] ICE in compute_live, at sel-sched.c:3097

2019-04-01 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86928

--- Comment #4 from Alexander Monakov  ---
Author: amonakov
Date: Mon Apr  1 16:32:24 2019
New Revision: 270061

URL: https://gcc.gnu.org/viewcvs?rev=270061=gcc=rev
Log:
sel-sched: update liveness in redirect_edge_and_branch hooks (PR 86928)

2019-04-01  Andrey Belevantsev  

PR rtl-optimization/86928
* sel-sched-ir.c (sel_redirect_edge_and_branch_force): Invoke
compute_live if necessary.
(sel_redirect_edge_and_branch): Likewise.

* gcc.dg/pr86928.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/pr86928.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/sel-sched-ir.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/86928] ICE in compute_live, at sel-sched.c:3097

2019-03-20 Thread abel at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86928

--- Comment #3 from Andrey Belevantsev  ---
(In reply to Andrey Belevantsev from comment #2)
> We're not somehow updating liveness information at all times when we change
> control flow.  E.g. we do update liveness in sel_split_edge, but not in
> sel_redirect_edge_and_branch{,force} hooks, when we're making a new jump and
> resetting liveness on the bb it ended up in.  This leaves us with the
> unknown lv set, and later breaks when we're computing liveness from the
> other region and come to this block, as we're assuming that other regions
> always have correct liveness.
> 
> Fixed with the below patch but I'm not completely sure it fully makes sense
> -- Alexander, thoughts?
> 
> diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
> index 85ff5bd3eb4..c399c1117a3 100644
> --- a/gcc/sel-sched-ir.c
> +++ b/gcc/sel-sched-ir.c
> @@ -5642,6 +5642,8 @@ sel_redirect_edge_and_branch_force (edge e,
> basic_block to)
>recompute_dominator (CDI_DOMINATORS, to));
>set_immediate_dominator (CDI_DOMINATORS, orig_dest,
>recompute_dominator (CDI_DOMINATORS, orig_dest));
> +  if (jump == sel_bb_head (BLOCK_FOR_INSN (jump)))
> +compute_live (jump);
>  }
> 
>  /* A wrapper for redirect_edge_and_branch.  Return TRUE if blocks connected
> by
> @@ -5702,6 +5704,8 @@ sel_redirect_edge_and_branch (edge e, basic_block to)
>set_immediate_dominator (CDI_DOMINATORS, orig_dest,
> recompute_dominator (CDI_DOMINATORS,
> orig_dest));
>  }
> +  if (jump == sel_bb_head (BLOCK_FOR_INSN (jump)))
> +compute_live (jump);
>return recompute_toporder_p;
>  }

It looks like the routine that creates recovery blocks also updates liveness,
so I'm now more confident with the patch, but I'd still like to hear
Alexander's opinion.  Of course, it should really be sel_bb_head_p (jump)
instead of that clumsy condition I've wrote.

[Bug rtl-optimization/86928] ICE in compute_live, at sel-sched.c:3097

2019-03-20 Thread abel at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86928

Andrey Belevantsev  changed:

   What|Removed |Added

 CC||abel at gcc dot gnu.org,
   ||amonakov at gcc dot gnu.org

--- Comment #2 from Andrey Belevantsev  ---
We're not somehow updating liveness information at all times when we change
control flow.  E.g. we do update liveness in sel_split_edge, but not in
sel_redirect_edge_and_branch{,force} hooks, when we're making a new jump and
resetting liveness on the bb it ended up in.  This leaves us with the unknown
lv set, and later breaks when we're computing liveness from the other region
and come to this block, as we're assuming that other regions always have
correct liveness.

Fixed with the below patch but I'm not completely sure it fully makes sense --
Alexander, thoughts?

diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 85ff5bd3eb4..c399c1117a3 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -5642,6 +5642,8 @@ sel_redirect_edge_and_branch_force (edge e, basic_block
to)
   recompute_dominator (CDI_DOMINATORS, to));
   set_immediate_dominator (CDI_DOMINATORS, orig_dest,
   recompute_dominator (CDI_DOMINATORS, orig_dest));
+  if (jump == sel_bb_head (BLOCK_FOR_INSN (jump)))
+compute_live (jump);
 }

 /* A wrapper for redirect_edge_and_branch.  Return TRUE if blocks connected by
@@ -5702,6 +5704,8 @@ sel_redirect_edge_and_branch (edge e, basic_block to)
   set_immediate_dominator (CDI_DOMINATORS, orig_dest,
recompute_dominator (CDI_DOMINATORS,
orig_dest));
 }
+  if (jump == sel_bb_head (BLOCK_FOR_INSN (jump)))
+compute_live (jump);
   return recompute_toporder_p;
 }

[Bug rtl-optimization/86928] ICE in compute_live, at sel-sched.c:3097

2018-10-03 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86928

Segher Boessenkool  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-10-03
 CC||segher at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Segher Boessenkool  ---
Confirmed.  Needs -m32.