m32c.c (m32c_emit_epilogue): Check for R8C or M16C chip and ignore the "fast_interrup...
authorDJ Delorie <dj@redhat.com>
Wed, 16 Sep 2009 22:18:30 +0000 (18:18 -0400)
committerDJ Delorie <dj@gcc.gnu.org>
Wed, 16 Sep 2009 22:18:30 +0000 (18:18 -0400)
* config/m32c/m32c.c (m32c_emit_epilogue): Check for R8C or M16C
chip and ignore the "fast_interrupt" attribute if so.

From-SVN: r151780

gcc/ChangeLog
gcc/config/m32c/m32c.c

index da86ebe958861287b369d0a1471ab96168808a1b..bbbc1bb95f7eca41426dbedd4b30998c49629e1a 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-16  DJ Delorie  <dj@redhat.com>
+
+       * config/m32c/m32c.c (m32c_emit_epilogue): Check for R8C or M16C
+       chip and ignore the "fast_interrupt" attribute if so.
+
 2009-09-16  Richard Henderson  <rth@redhat.com>
 
        PR middle-end/41360
index ae4c8973dea882fdb5cf62901de42b78b5fff44e..1bf3d1bcb2f0d4bcf7d543950013492fdf7489c0 100644 (file)
@@ -4052,8 +4052,26 @@ m32c_emit_epilogue (void)
       if (!bank_switch_p (cfun->decl) && cfun->machine->intr_pushm)
        emit_insn (gen_popm (GEN_INT (cfun->machine->intr_pushm)));
 
+      /* The FREIT (Fast REturn from InTerrupt) instruction should be
+         generated only for M32C/M32CM targets (generate the REIT
+         instruction otherwise).  */
       if (fast_interrupt_p (cfun->decl))
-       emit_jump_insn (gen_epilogue_freit ());
+        {
+          /* Check if fast_attribute is set for M32C or M32CM.  */
+          if (TARGET_A24)
+            {
+              emit_jump_insn (gen_epilogue_freit ());
+            }
+          /* If fast_interrupt attribute is set for an R8C or M16C
+             target ignore this attribute and generated REIT
+             instruction.  */
+          else
+           {
+             warning (OPT_Wattributes,
+                      "%<fast_interrupt%> attribute directive ignored");
+             emit_jump_insn (gen_epilogue_reit_16 ());
+           }
+        }
       else if (TARGET_A16)
        emit_jump_insn (gen_epilogue_reit_16 ());
       else