This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pretty-ipa merge 13: split_critical_edges hack WRT EH edges


On Fri, 24 Apr 2009, Jan Hubicka wrote:

> Hi,
> this patch makes PRE happy with EH edges, the problem is described in
> comment bellow. 
> 
> Bootstrapped/regtested x86_64-linux. OK?
> 
> Honza
> 	* tree-cfg.c (split_critical_edges): Split also edges where we can't
> 	insert code even if they are not critical.
> *** /aux/hubicka/trunk-write/gcc/tree-cfg.c	Wed Apr 22 15:38:19 2009
> --- tree-cfg.c	Sat Apr 18 17:56:15 2009
> *************** split_critical_edges (void)
> *** 6992,7001 ****
>     FOR_ALL_BB (bb)
>       {
>         FOR_EACH_EDGE (e, ei, bb->succs)
> ! 	if (EDGE_CRITICAL_P (e) && !(e->flags & EDGE_ABNORMAL))
> ! 	  {
>   	    split_edge (e);
> ! 	  }
>       }
>     end_recording_case_labels ();
>     return 0;
> --- 7009,7039 ----
>     FOR_ALL_BB (bb)
>       {
>         FOR_EACH_EDGE (e, ei, bb->succs)
> !         {
> ! 	  if (EDGE_CRITICAL_P (e) && !(e->flags & EDGE_ABNORMAL))
>   	    split_edge (e);
> ! 	  /* PRE inserts statements to edes and expect that 

edges and expects

> ! 	     since split_critical_edges was done beforehand, commiting edge

committing

> ! 	     insertions will not split more edges.  In addition to critical
> ! 	     edges we must split edges that has mulptiple succestors and

that have multiple successors

> ! 	     ends by control flow statement, such as RESX.

end by control flow statements
 
> ! 	     Go ahead and split them too.  This match logic in

matches the logic

Ok with these changes.

Thanks,
Richard.

> ! 	     gimple_find_edge_insert_loc.  */
> ! 	  else if ((!single_pred_p (e->dest)
> ! 	            || phi_nodes (e->dest)
> ! 	            || e->dest == EXIT_BLOCK_PTR)
> ! 		   && e->src != ENTRY_BLOCK_PTR
> ! 	           && !(e->flags & EDGE_ABNORMAL))
> ! 	    {
> ! 	      gimple_stmt_iterator gsi;
> ! 
> ! 	      gsi = gsi_last_bb (e->src);
> ! 	      if (!gsi_end_p (gsi)
> ! 		  && stmt_ends_bb_p (gsi_stmt (gsi))
> ! 		  && gimple_code (gsi_stmt (gsi)) != GIMPLE_RETURN)
> ! 		split_edge (e);
> ! 	    }
> ! 	}
>       }
>     end_recording_case_labels ();
>     return 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]