OSDN Git Service

PR bootstrap/15141
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Apr 2004 03:17:08 +0000 (03:17 +0000)
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Apr 2004 03:17:08 +0000 (03:17 +0000)
* except.c (connect_post_landing_pads): Delete insns after the
barrier when generating a unwind_resume_libfunc call.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81176 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/except.c

index b74866c..f9f097f 100644 (file)
@@ -1,3 +1,9 @@
+2004-04-26  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       PR bootstrap/15141
+       * except.c (connect_post_landing_pads): Delete insns after the
+       barrier when generating a unwind_resume_libfunc call.
+
 2004-04-25  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        PR/c++ 15119
 2004-04-25  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        PR/c++ 15119
index 36e3f43..d7daec3 100644 (file)
@@ -1830,8 +1830,21 @@ connect_post_landing_pads (void)
          e->count = src->count;
        }
       else
          e->count = src->count;
        }
       else
-       emit_library_call (unwind_resume_libfunc, LCT_THROW,
-                          VOIDmode, 1, cfun->eh->exc_ptr, ptr_mode);
+       {
+         emit_library_call (unwind_resume_libfunc, LCT_THROW,
+                            VOIDmode, 1, cfun->eh->exc_ptr, ptr_mode);
+
+         /* What we just emitted was a throwing libcall, so it got a
+            barrier automatically added after it.  If the last insn in
+            the libcall sequence isn't the barrier, it's because the
+            target emits multiple insns for a call, and there are insns
+            after the actual call insn (which are redundant and would be
+            optimized away).  The barrier is inserted exactly after the
+            call insn, so let's go get that and delete the insns after
+            it, because below we need the barrier to be the last insn in
+            the sequence.  */
+         delete_insns_since (NEXT_INSN (last_call_insn ()));
+       }
 
       seq = get_insns ();
       end_sequence ();
 
       seq = get_insns ();
       end_sequence ();