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: [mainline/tree-profiling] CFG transparend finish_eh_generation


On Fri, Sep 02, 2005 at 06:28:08PM +0930, Alan Modra wrote:
> Jan, the following change of yours is responsible for PR21460.  Can you
> remember why you wanted to look for NOTE_INSN_BASIC_BLOCK?

Never mind, I'm bootstrapping this fix.

	PR target/21460
	* except.c (sjlj_emit_function_enter): Find the function begin
	note even when it's not in first basic block.

Index: gcc/except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.315
diff -u -p -r1.315 except.c
--- gcc/except.c	10 Aug 2005 09:02:38 -0000	1.315
+++ gcc/except.c	2 Sep 2005 15:24:48 -0000
@@ -1728,6 +1728,7 @@ static void
 sjlj_emit_function_enter (rtx dispatch_label)
 {
   rtx fn_begin, fc, mem, seq;
+  bool fn_begin_outside_block;
 
   fc = cfun->eh->sjlj_fc;
 
@@ -1783,23 +1784,20 @@ sjlj_emit_function_enter (rtx dispatch_l
      do this in a block that is at loop level 0 and dominates all
      can_throw_internal instructions.  */
 
+  fn_begin_outside_block = true;
   for (fn_begin = get_insns (); ; fn_begin = NEXT_INSN (fn_begin))
-    if (NOTE_P (fn_begin)
-	&& (NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_FUNCTION_BEG
-	    || NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_BASIC_BLOCK))
-      break;
-  if (NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_FUNCTION_BEG)
+    if (NOTE_P (fn_begin))
+      {
+	if (NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_FUNCTION_BEG)
+	  break;
+	else if (NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_BASIC_BLOCK)
+	  fn_begin_outside_block = false;
+      }
+
+  if (fn_begin_outside_block)
     insert_insn_on_edge (seq, single_succ_edge (ENTRY_BLOCK_PTR));
   else
-    {
-      rtx last = BB_END (single_succ (ENTRY_BLOCK_PTR));
-      for (; ; fn_begin = NEXT_INSN (fn_begin))
-	if ((NOTE_P (fn_begin)
-	     && NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_FUNCTION_BEG)
-	    || fn_begin == last)
-	  break;
-      emit_insn_after (seq, fn_begin);
-    }
+    emit_insn_after (seq, fn_begin);
 }
 
 /* Call back from expand_function_end to know where we should put

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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