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 finish_eh_generation after full cleanup_cfg


Hi,
on tree-profiling branch I do cfg_cleanup early before finish_eh_generation.
This cause labels reachable via EH edges to be fallthru destinations too.  except.c
inserts code before those labels excepting them to be executed only at the EH edges.
Fixed thus.

Bootstrapped/regtested i686-pc-gnu-linux, will install it shortly to
tree-profiling branch.  OK for mainline?

2004-03-07  Jan Hubicka  <jh@suse.cz>
	* except.c (emit_to_new_bb_before):  Break fallthru edges.
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.227.2.24.2.1
diff -c -3 -p -r1.227.2.24.2.1 except.c
*** except.c	3 Mar 2004 14:17:53 -0000	1.227.2.24.2.1
--- except.c	7 Mar 2004 01:38:58 -0000
*************** emit_to_new_bb_before (rtx seq, rtx insn
*** 1799,1805 ****
--- 1799,1812 ----
  {
    rtx last;
    basic_block bb;
+   edge e;
  
+   /* If there happens to be an fallthru edge (possibly created by cleanup_cfg
+      call), we don't want it to go into newly created landing pad or other EH 
+      construct.  */
+   for (e = BLOCK_FOR_INSN (insn)->pred; e; e = e->pred_next)
+     if (e->flags & EDGE_FALLTHRU)
+       force_nonfallthru (e);
    last = emit_insn_before (seq, insn);
    if (GET_CODE (last) == BARRIER)
      last = PREV_INSN (last);


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