This is the mail archive of the
mailing list for the GCC project.
Fix finish_eh_generation after full cleanup_cfg
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Sun, 7 Mar 2004 02:41:10 +0100
- Subject: Fix finish_eh_generation after full cleanup_cfg
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.
Bootstrapped/regtested i686-pc-gnu-linux, will install it shortly to
tree-profiling branch. OK for mainline?
2004-03-07 Jan Hubicka <email@example.com>
* except.c (emit_to_new_bb_before): Break fallthru edges.
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 22.214.171.124.2.1
diff -c -3 -p -r126.96.36.199.2.1 except.c
*** except.c 3 Mar 2004 14:17:53 -0000 188.8.131.52.2.1
--- except.c 7 Mar 2004 01:38:58 -0000
*************** emit_to_new_bb_before (rtx seq, rtx insn
*** 1799,1805 ****
--- 1799,1812 ----
+ 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);