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]

[patch] for PR23626


Hello,

when replace_uses_by turns a possibly trapping memory refence into one
that provably cannot trap (e.g., a[i] to a[5]), it needs to clean up
eh info and remove dead eh edges.

Bootstrapped & regtested on i686.

Zdenek

	PR tree-optimization/23626
	* tree-cfg.c (replace_uses_by): Clean up eh info.

Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.217
diff -c -3 -p -r2.217 tree-cfg.c
*** tree-cfg.c	24 Aug 2005 07:56:54 -0000	2.217
--- tree-cfg.c	30 Aug 2005 12:27:02 -0000
*************** replace_uses_by (tree name, tree val)
*** 1273,1278 ****
--- 1273,1282 ----
        if (TREE_CODE (rhs) == ADDR_EXPR)
  	recompute_tree_invarant_for_addr_expr (rhs);
  
+       /* If the statement could throw and now cannot, we need to prune cfg.  */
+       if (maybe_clean_or_replace_eh_stmt (stmt, stmt))
+ 	tree_purge_dead_eh_edges (bb_for_stmt (stmt));
+ 
        mark_new_vars_to_rename (stmt);
      }
  


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