except.c (emit_eh_context): Make the EH context register stay alive at -O0 so stupid...
authorAndrew MacLeod <amacleod@cygnus.com>
Thu, 29 Oct 1998 11:21:20 +0000 (11:21 +0000)
committerAndrew Macleod <amacleod@gcc.gnu.org>
Thu, 29 Oct 1998 11:21:20 +0000 (11:21 +0000)
Thu Oct 29 14:10:22 EST 1998  Andrew MacLeod  <amacleod@cygnus.com>
        * except.c (emit_eh_context): Make the EH context register stay alive
        at -O0 so stupid.c doesn't get confused.

From-SVN: r23423

gcc/ChangeLog
gcc/except.c

index 1dbc93a050bfe82bfb0db50b699022f92a31efdb..b01e4eaf05842419d86d3c7d7b7f8d1c74d8bc88 100644 (file)
@@ -1,3 +1,8 @@
+Thu Oct 29 14:10:22 EST 1998  Andrew MacLeod  <amacleod@cygnus.com>
+
+       * except.c (emit_eh_context): Make the EH context register stay alive
+       at -O0 so stupid.c doesn't get confused.
+
 1998-10-29 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
 
        * emit-rtl.c (try_split): Do not try to split a BARRIER.
index 867b4a5bdf6af0504d3e0b04d5ad384e6412398e..d07d6bf0d40eb86ff77f315bcae4f8f92bc80d38 100644 (file)
@@ -2094,6 +2094,14 @@ emit_eh_context ()
            end_sequence ();
 
            emit_insns_before (insns, insn);
+
+            /* At -O0, we must make the context register stay alive so
+               that the stupid.c register allocator doesn't get confused. */
+            if (obey_regdecls != 0)
+              {
+                insns = gen_rtx_USE (GET_MODE (XEXP (reg,0)), XEXP (reg,0));
+                emit_insn_before (insns, get_last_insn ());
+              }
          }
       }
 }