re PR target/32325 (cc1plus ICE configuring libstdc++ on Tru64 UNIX V5.1B: SEGV in...
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 22 Sep 2007 08:42:57 +0000 (08:42 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 22 Sep 2007 08:42:57 +0000 (08:42 +0000)
PR target/32325
* except.c (finish_eh_generation): Call commit_edge_insertions if
there are insns queued on the entry edge.
* config/alpha/alpha.c (alpha_gp_save_rtx): Insert the insns on
the entry edge.

From-SVN: r128665

gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/except.c

index 116aa78558ae395f9bc25bf294ad5a8ee177840e..20bf0529736b53f90a6dc4eb588afa82c7c1db4c 100644 (file)
@@ -1,3 +1,11 @@
+2007-09-22  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR target/32325
+       * except.c (finish_eh_generation): Call commit_edge_insertions if
+       there are insns queued on the entry edge.
+       * config/alpha/alpha.c (alpha_gp_save_rtx): Insert the insns on
+       the entry edge.
+
 2007-09-22  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        * doc/sourcebuild.texi (dg-add-c99-runtime-options): Document.
index 48696b5ddbdbe40cc90c003ca2a902c2a663a0da..fee5cd11115f89cfc407b0dcaa4cdc3c4e3a9412 100644 (file)
@@ -4780,7 +4780,14 @@ alpha_gp_save_rtx (void)
 
       seq = get_insns ();
       end_sequence ();
-      emit_insn_at_entry (seq);
+
+      /* We used to simply emit the sequence after entry_of_function.
+        However this breaks the CFG if the first instruction in the
+        first block is not the NOTE_INSN_BASIC_BLOCK, for example a
+        label.  Emit the sequence properly on the edge.  We are only
+        invoked from dw2_build_landing_pads and finish_eh_generation
+        will call commit_edge_insertions thanks to a kludge.  */
+      insert_insn_on_edge (seq, single_succ_edge (ENTRY_BLOCK_PTR));
 
       cfun->machine->gp_save_rtx = m;
     }
index f3204eb863ace383c23470a7ca854bf7ce4cd742..fe98299450d19ca9ba1a1bc66a9504fbb71a220b 100644 (file)
@@ -2107,7 +2107,9 @@ finish_eh_generation (void)
   /* We've totally changed the CFG.  Start over.  */
   find_exception_handler_labels ();
   break_superblocks ();
-  if (USING_SJLJ_EXCEPTIONS)
+  if (USING_SJLJ_EXCEPTIONS
+      /* Kludge for Alpha/Tru64 (see alpha_gp_save_rtx).  */
+      || single_succ_edge (ENTRY_BLOCK_PTR)->insns.r)
     commit_edge_insertions ();
   FOR_EACH_BB (bb)
     {