This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[dataflow] Provide a blockage insn for targets that don't have it


This patch provides a gen_blockage routine for targets that don't have a blockage insn. This is implemented as a dummy `asm ("")' instruction. Unlike previous code that used ASM_INPUT in this way, this instruction is made volatile so that it is not deleted by the DCE pass.

Ok for dataflow branch? This is necessary in order to compile avr-elf on the branch.

Paolo

2007-02-22 Paolo Bonzini <bonzini@gnu.org>

        * emit-rtl.c [!HAVE_blockage]: Provide a gen_blockage routine here.
        * rtl.h (gen_blockage): Add prototype.

Index: emit-rtl.c
===================================================================
--- emit-rtl.c  (revision 122195)
+++ emit-rtl.c  (working copy)
@@ -360,6 +360,18 @@ get_reg_attrs (tree decl, int offset)
   return *slot;
 }

+#if !HAVE_blockage
+/* Generate an empty ASM_INPUT, which is used to block attempts across this insn. */
+
+rtx
+gen_blockage (void)
+{
+ rtx x = gen_rtx_ASM_INPUT (VOIDmode, "");
+ MEM_VOLATILE_P (x) = true;
+ return x;
+}
+#endif
+
/* Generate a new REG rtx. Make sure ORIGINAL_REGNO is set properly, and
don't attempt to share with the various global pieces of rtl (such as
frame_pointer_rtx). */
Index: rtl.h
===================================================================
--- rtl.h (revision 122195)
+++ rtl.h (working copy)
@@ -1444,6 +1444,7 @@ extern HOST_WIDE_INT trunc_int_for_mode
extern rtx plus_constant (rtx, HOST_WIDE_INT);


 /* In emit-rtl.c */
+extern rtx gen_blockage (void);
 extern rtvec gen_rtvec (int, ...);
 extern rtx copy_insn_1 (rtx);
 extern rtx copy_insn (rtx);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]