]> gcc.gnu.org Git - gcc.git/commitdiff
except.c (dw2_build_landing_pads): New local clobbers_hard_regs.
authorJeff Sturm <jsturm@one-point.com>
Mon, 17 Sep 2001 23:16:28 +0000 (23:16 +0000)
committerJeff Sturm <jsturm@gcc.gnu.org>
Mon, 17 Sep 2001 23:16:28 +0000 (23:16 +0000)
* except.c (dw2_build_landing_pads): New local
clobbers_hard_regs.  Emit an ASM_INPUT as a scheduling
barrier after clobbers.  Fixes c++/4012.

From-SVN: r45667

gcc/ChangeLog
gcc/except.c

index 1e8d4f04ce88f48729f9cb7ecc25c75c58525aa8..6a069f1a9681f5a4b688e26eda836ffe4cb2b0aa 100644 (file)
@@ -1,3 +1,9 @@
+2001-09-17  Jeff Sturm  <jsturm@one-point.com>
+
+       * except.c (dw2_build_landing_pads): New local
+       clobbers_hard_regs.  Emit an ASM_INPUT as a scheduling
+       barrier after clobbers.  Fixes c++/4012.
+
 2001-09-17  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * gcc.c (find_file): Use ACONCAT in lieu of alloca/strcpy/strcat.
index 90423a7752f73f3fc6e7ba791a53ba291ef5ca4e..bc21b2c07e29646b16458cba3d9f76cb10e9635e 100644 (file)
@@ -1865,6 +1865,7 @@ dw2_build_landing_pads ()
     {
       struct eh_region *region = cfun->eh->region_array[i];
       rtx seq;
+      bool clobbers_hard_regs = false;
 
       /* Mind we don't process a region more than once.  */
       if (!region || region->region_number != i)
@@ -1901,7 +1902,19 @@ dw2_build_landing_pads ()
          if (r == INVALID_REGNUM)
            break;
          if (! call_used_regs[r])
-           emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, r)));
+           {
+             emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, r)));
+             clobbers_hard_regs = true;
+           }
+       }
+
+      if (clobbers_hard_regs)
+       {
+         /* @@@ This is a kludge.  Not all machine descriptions define a
+            blockage insn, but we must not allow the code we just generated
+            to be reordered by scheduling.  So emit an ASM_INPUT to act as
+            blockage insn. */
+         emit_insn (gen_rtx_ASM_INPUT (VOIDmode, ""));
        }
 
       emit_move_insn (cfun->eh->exc_ptr,
This page took 0.077268 seconds and 5 git commands to generate.