Patchwork Fix ICE with dangling abnormal call edges

login
register
mail settings
Submitter Eric Botcazou
Date Oct. 20, 2010, 10:24 a.m.
Message ID <201010201224.04225.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/68422/
State New
Headers show

Comments

Eric Botcazou - Oct. 20, 2010, 10:24 a.m.
> OK, I'll add it and retest, thanks.

That worked fine so I've installed it.

However, as the attached testcase demonstrates, dangling abnormal call edges 
may be pre-existing, when local-pure-const discovers that a function is pure.
So the attached patch is also needed.  OK for mainline after full testing?


2010-10-20  Eric Botcazou  <ebotcazou@adacore.com>

	* tree-optimize.c (execute_fixup_cfg): Purge dead abnormal call edges
	if there is a call statement to pure or const function in the block.
Richard Guenther - Oct. 20, 2010, 11:04 a.m.
On Wed, Oct 20, 2010 at 12:24 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> OK, I'll add it and retest, thanks.
>
> That worked fine so I've installed it.
>
> However, as the attached testcase demonstrates, dangling abnormal call edges
> may be pre-existing, when local-pure-const discovers that a function is pure.
> So the attached patch is also needed.  OK for mainline after full testing?

Ok.

Thanks,
Richard.

>
> 2010-10-20  Eric Botcazou  <ebotcazou@adacore.com>
>
>        * tree-optimize.c (execute_fixup_cfg): Purge dead abnormal call edges
>        if there is a call statement to pure or const function in the block.
>
>
> --
> Eric Botcazou
>

Patch

Index: tree-optimize.c
===================================================================
--- tree-optimize.c	(revision 165574)
+++ tree-optimize.c	(working copy)
@@ -271,13 +271,16 @@  execute_fixup_cfg (void)
 	      int flags = gimple_call_flags (stmt);
 	      if (flags & (ECF_CONST | ECF_PURE | ECF_LOOPING_CONST_OR_PURE))
 		{
+		  if (gimple_purge_dead_abnormal_call_edges (bb))
+		    todo |= TODO_cleanup_cfg;
+
 		  if (gimple_in_ssa_p (cfun))
 		    {
 		      todo |= TODO_update_ssa | TODO_cleanup_cfg;
 		      update_stmt (stmt);
 		    }
 		}
-	      
+
 	      if (flags & ECF_NORETURN
 		  && fixup_noreturn_call (stmt))
 		todo |= TODO_cleanup_cfg;