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]

Fix handling of calls wrt EH


Hi,
this patch, analogous to what we do in eh lowering code already, makes
expand_call to get EH right in duplicated statements.  It fixes couple
of EH failures with CFG inliner but it is also latent bug in 4.0. Not
sure if it is best way around, but I don't seem to see anything better
except for reorganizing interface of call_expr that seems dificlt.

Bootstrapped/regtested i686-pc-gnu-linux, OK for mainline and 4.0 branch?
2005-05-13  Jan Hubicka  <jh@suse.cz>
	* tree-eh.c (add_stmt_to_eh_region_fn, remove_stmt_from_eh_region_fn):
	Mark the CALL_EXPR itself too.
Index: tree-eh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-eh.c,v
retrieving revision 2.35
diff -c -3 -p -r2.35 tree-eh.c
*** tree-eh.c	12 May 2005 19:29:21 -0000	2.35
--- tree-eh.c	13 May 2005 00:38:56 -0000
*************** add_stmt_to_eh_region_fn (struct functio
*** 120,125 ****
--- 120,132 ----
    slot = htab_find_slot (get_eh_throw_stmt_table (ifun), n, INSERT);
    gcc_assert (!*slot);
    *slot = n;
+   /* ??? For the benefit of calls.c, converting all this to rtl,
+      we need to record the call expression, not just the outer
+      modify statement.  */
+   if ((TREE_CODE (t) == MODIFY_EXPR
+        || TREE_CODE (t) == RETURN_EXPR)
+       && (t = get_call_expr_in (t)))
+     add_stmt_to_eh_region_fn (ifun, t, num);
  }
  
  void
*************** remove_stmt_from_eh_region_fn (struct fu
*** 143,148 ****
--- 150,162 ----
    if (slot)
      {
        htab_clear_slot (get_eh_throw_stmt_table (ifun), slot);
+       /* ??? For the benefit of calls.c, converting all this to rtl,
+ 	 we need to record the call expression, not just the outer
+ 	 modify statement.  */
+       if ((TREE_CODE (t) == MODIFY_EXPR
+ 	   || TREE_CODE (t) == RETURN_EXPR)
+           && (t = get_call_expr_in (t)))
+ 	remove_stmt_from_eh_region_fn (ifun, t);
        return true;
      }
    
    else


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