diff mbox

Fix lto-symtab ICE during Ada LTO bootstrap

Message ID 3448714.nhJ8om10cS@polaris
State New
Headers show

Commit Message

Eric Botcazou Dec. 21, 2015, 10:19 a.m. UTC
> It's apparently another bug in the DCE pass.  

But it comes from a stalled ABNORMAL flag after the FRE3 pass so:

 		}

is apparently sufficient.  Testing...

Comments

Jan Hubicka Dec. 21, 2015, 2:19 p.m. UTC | #1
Hi,
the change in my patch was intentional, I forgot to send the email. Sorry for that.
The reason is that labels/predictions/debug statements now go specially though DCE
and are marked as neecessary, but not really handled so (i.e. we can remove conditional
controlling only debug statements).
This can cause an infinite loop.
> > It's apparently another bug in the DCE pass.  
> 
> But it comes from a stalled ABNORMAL flag after the FRE3 pass so:

I suppose the CFG verifier should also catch this.  I wonder how this can lead
to wrong code as opossed to infinite loop?
I can imagine DCE being confused about non-control-flow stmt and conclude the
abnormal path as the path leaving the loop.  I will look into the testcase more.

Thanks for working this out!
Honza
> 
> Index: tree-ssa-pre.c
> ===================================================================
> --- tree-ssa-pre.c	(revision 231856)
> +++ tree-ssa-pre.c	(working copy)
> @@ -4128,6 +4128,14 @@ eliminate_dom_walker::before_dom_childre
>  		      print_gimple_stmt (dump_file, stmt, 0, 0);
>  		    }
>  
> +		  if (is_gimple_call (stmt)
> +		      && stmt_can_make_abnormal_goto (stmt))
> +		    {
> +		      bitmap_set_bit (need_ab_cleanup, gimple_bb (stmt)-
> >index);
> +		      if (dump_file && (dump_flags & TDF_DETAILS))
> +			fprintf (dump_file, "  Removed AB side-effects.\n");
> +		    }
> +
>  		  pre_stats.eliminations++;
>  		  continue;
>  		}
> 
> is apparently sufficient.  Testing...
> 
> -- 
> Eric Botcazou
Jan Hubicka Dec. 21, 2015, 2:20 p.m. UTC | #2
H.J.,
also once we get to bootstrapland with Ada and LTO, would be possible to enable
it on the LTO bootstrap tester, so we won't break it again?

Thanks,
Honza
diff mbox

Patch

Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c	(revision 231856)
+++ tree-ssa-pre.c	(working copy)
@@ -4128,6 +4128,14 @@  eliminate_dom_walker::before_dom_childre
 		      print_gimple_stmt (dump_file, stmt, 0, 0);
 		    }
 
+		  if (is_gimple_call (stmt)
+		      && stmt_can_make_abnormal_goto (stmt))
+		    {
+		      bitmap_set_bit (need_ab_cleanup, gimple_bb (stmt)-
>index);
+		      if (dump_file && (dump_flags & TDF_DETAILS))
+			fprintf (dump_file, "  Removed AB side-effects.\n");
+		    }
+
 		  pre_stats.eliminations++;
 		  continue;