sparc-passes.def: New file.
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 14 Oct 2016 19:11:15 +0000 (19:11 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 14 Oct 2016 19:11:15 +0000 (19:11 +0000)
* config/sparc/sparc-passes.def: New file.
* config/sparc/t-sparc (PASSES_EXTRA): Add sparc-passes.def.
* config/sparc/sparc-protos.h (make_pass_work_around_errata): New.
* config/sparc/sparc.c (sparc_option_override): Don't register passes.

From-SVN: r241180

gcc/ChangeLog
gcc/config/sparc/sparc-passes.def [new file with mode: 0644]
gcc/config/sparc/sparc-protos.h
gcc/config/sparc/sparc.c
gcc/config/sparc/t-sparc

index a998060..63034cd 100644 (file)
@@ -1,3 +1,10 @@
+2016-10-14  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * config/sparc/sparc-passes.def: New file.
+       * config/sparc/t-sparc (PASSES_EXTRA): Add sparc-passes.def.
+       * config/sparc/sparc-protos.h (make_pass_work_around_errata): New.
+       * config/sparc/sparc.c (sparc_option_override): Don't register passes.
+
 2016-10-14  Pat Haugen  <pthaugen@us.ibm.com>
 
        * loop-unroll.c (unroll_loop_runtime_iterations): Condition initial
@@ -13,8 +20,7 @@
 
 2016-10-14  Pedro Alves  <palves@redhat.com>
 
-       * coretypes.h (OVERRIDE, FINAL): Delete, moved to
-       include/ansidecl.h.
+       * coretypes.h (OVERRIDE, FINAL): Delete, moved to include/ansidecl.h.
 
 2016-10-14  Catherine Moore  <clm@codesourcery.com>
 
diff --git a/gcc/config/sparc/sparc-passes.def b/gcc/config/sparc/sparc-passes.def
new file mode 100644 (file)
index 0000000..76296b7
--- /dev/null
@@ -0,0 +1,27 @@
+/* Description of target passes for SPARC. 
+   Copyright (C) 2016 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/*
+   Macros that can be used in this file:
+   INSERT_PASS_AFTER (PASS, INSTANCE, TGT_PASS)
+   INSERT_PASS_BEFORE (PASS, INSTANCE, TGT_PASS)
+   REPLACE_PASS (PASS, INSTANCE, TGT_PASS)
+ */
+
+  INSERT_PASS_AFTER (pass_delay_slots, 1, pass_work_around_errata);
index 2308b91..4e23a44 100644 (file)
@@ -47,6 +47,7 @@ extern void sparc_profile_hook (int);
 extern void sparc_override_options (void);
 extern void sparc_output_scratch_registers (FILE *);
 extern void sparc_target_macros (void);
+extern void sparc_emit_membar_for_model (enum memmodel, int, int);
 
 #ifdef RTX_CODE
 extern machine_mode select_cc_mode (enum rtx_code, rtx, rtx);
@@ -110,6 +111,6 @@ unsigned int sparc_regmode_natural_size (machine_mode);
 bool sparc_modes_tieable_p (machine_mode, machine_mode);
 #endif /* RTX_CODE */
 
-extern void sparc_emit_membar_for_model (enum memmodel, int, int);
+extern rtl_opt_pass *make_pass_work_around_errata (gcc::context *);
 
 #endif /* __SPARC_PROTOS_H__ */
index ac05d96..8633b8d 100644 (file)
@@ -883,10 +883,10 @@ mem_ref (rtx x)
 }
 
 /* We use a machine specific pass to enable workarounds for errata.
+
    We need to have the (essentially) final form of the insn stream in order
    to properly detect the various hazards.  Therefore, this machine specific
-   pass runs as late as possible.  The pass is inserted in the pass pipeline
-   at the end of sparc_option_override.  */
+   pass runs as late as possible.  */
 
 static unsigned int
 sparc_do_work_around_errata (void)
@@ -1706,21 +1706,6 @@ sparc_option_override (void)
      pessimizes for double floating-point registers.  */
   if (!global_options_set.x_flag_ira_share_save_slots)
     flag_ira_share_save_slots = 0;
-
-  /* We register a machine specific pass to work around errata, if any.
-     The pass mut be scheduled as late as possible so that we have the
-     (essentially) final form of the insn stream to work on.
-     Registering the pass must be done at start up.  It's convenient to
-     do it here.  */
-  opt_pass *errata_pass = make_pass_work_around_errata (g);
-  struct register_pass_info insert_pass_work_around_errata =
-    {
-      errata_pass,             /* pass */
-      "dbr",                   /* reference_pass_name */
-      1,                       /* ref_pass_instance_number */
-      PASS_POS_INSERT_AFTER    /* po_op */
-    };
-  register_pass (&insert_pass_work_around_errata);
 }
 \f
 /* Miscellaneous utilities.  */
index 1b691c4..ec396b0 100644 (file)
@@ -18,6 +18,8 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
+PASSES_EXTRA += $(srcdir)/config/sparc/sparc-passes.def
+
 sparc-c.o: $(srcdir)/config/sparc/sparc-c.c
        $(COMPILE) $<
        $(POSTCOMPILE)