From 6af11d2bf41df9baf3fda28f4a270d6d4de65341 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 14 Oct 2016 19:11:15 +0000 Subject: [PATCH] sparc-passes.def: New file. * 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 | 10 ++++++++-- gcc/config/sparc/sparc-passes.def | 27 +++++++++++++++++++++++++++ gcc/config/sparc/sparc-protos.h | 3 ++- gcc/config/sparc/sparc.c | 19 ++----------------- gcc/config/sparc/t-sparc | 2 ++ 5 files changed, 41 insertions(+), 20 deletions(-) create mode 100644 gcc/config/sparc/sparc-passes.def diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a998060b3b3..63034cd6d58 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-10-14 Eric Botcazou + + * 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 * loop-unroll.c (unroll_loop_runtime_iterations): Condition initial @@ -13,8 +20,7 @@ 2016-10-14 Pedro Alves - * 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 diff --git a/gcc/config/sparc/sparc-passes.def b/gcc/config/sparc/sparc-passes.def new file mode 100644 index 00000000000..76296b7ae6e --- /dev/null +++ b/gcc/config/sparc/sparc-passes.def @@ -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 +. */ + +/* + 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); diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h index 2308b91b42e..4e23a4406c7 100644 --- a/gcc/config/sparc/sparc-protos.h +++ b/gcc/config/sparc/sparc-protos.h @@ -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__ */ diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index ac05d96b97c..8633b8d34f9 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -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); } /* Miscellaneous utilities. */ diff --git a/gcc/config/sparc/t-sparc b/gcc/config/sparc/t-sparc index 1b691c43c79..ec396b04ee3 100644 --- a/gcc/config/sparc/t-sparc +++ b/gcc/config/sparc/t-sparc @@ -18,6 +18,8 @@ # along with GCC; see the file COPYING3. If not see # . +PASSES_EXTRA += $(srcdir)/config/sparc/sparc-passes.def + sparc-c.o: $(srcdir)/config/sparc/sparc-c.c $(COMPILE) $< $(POSTCOMPILE)