aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2016-10-11 08:02:48 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2016-10-11 08:02:48 +0000
commit76beabf41a6e89bc773ede6c7709d41b3be14821 (patch)
treee0b440c80cd14688bfa45f4afb4b3ac2664396e3 /gcc
parent7c507664891d053d0e95e3c7f179a2043c2b1210 (diff)
downloadgcc-76beabf41a6e89bc773ede6c7709d41b3be14821.zip
gcc-76beabf41a6e89bc773ede6c7709d41b3be14821.tar.gz
gcc-76beabf41a6e89bc773ede6c7709d41b3be14821.tar.bz2
New avr-passes.def to register AVR specific passes.
* config/avr/avr-passes.def: New file. * config/avr/t-avr (PASSES_EXTRA): Add avr-passes.def. * config/avr/avr-protos.h (gcc::context, rtl_opt_pass): Declare. (make_avr_pass_recompute_note): New proto. * config/avr/avr.c (make_avr_pass_recompute_notes): New function. (avr_pass_recompute_notes): Use anonymous namespace. (avr_register_passes): Remove function... (avr_option_override): ...and its call. From-SVN: r240966
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config/avr/avr-passes.def28
-rw-r--r--gcc/config/avr/avr-protos.h5
-rw-r--r--gcc/config/avr/avr.c22
-rw-r--r--gcc/config/avr/t-avr2
5 files changed, 53 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a8860a5..8dbf87c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2016-10-11 Georg-Johann Lay <avr@gjlay.de>
+
+ New avr-passes.def to register AVR specific passes.
+
+ * config/avr/avr-passes.def: New file.
+ * config/avr/t-avr (PASSES_EXTRA): Add avr-passes.def.
+ * config/avr/avr-protos.h (gcc::context, rtl_opt_pass): Declare.
+ (make_avr_pass_recompute_note): New proto.
+ * config/avr/avr.c (make_avr_pass_recompute_notes): New function.
+ (avr_pass_recompute_notes): Use anonymous namespace.
+ (avr_register_passes): Remove function...
+ (avr_option_override): ...and its call.
+
2016-10-11 Robert Suchanek <robert.suchanek@imgtec.com>
* config/mips/mips-cpus.def: Replace PTF_AVOID_BRANCHLIKELY with
diff --git a/gcc/config/avr/avr-passes.def b/gcc/config/avr/avr-passes.def
new file mode 100644
index 0000000..64d9ce4
--- /dev/null
+++ b/gcc/config/avr/avr-passes.def
@@ -0,0 +1,28 @@
+/* Description of target passes for AVR.
+ 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/>. */
+
+/* This avr-specific pass (re)computes insn notes, in particular REG_DEAD
+ notes which are used by `avr.c::reg_unused_after' and branch offset
+ computations. These notes must be correct, i.e. there must be no
+ dangling REG_DEAD notes; otherwise wrong code might result, cf. PR64331.
+
+ DF needs (correct) CFG, hence right before free_cfg is the last
+ opportunity to rectify notes. */
+
+INSERT_PASS_BEFORE (pass_free_cfg, 1, avr_pass_recompute_notes);
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h
index ddc3047..1a5efa8 100644
--- a/gcc/config/avr/avr-protos.h
+++ b/gcc/config/avr/avr-protos.h
@@ -154,6 +154,11 @@ extern void asm_output_float (FILE *file, REAL_VALUE_TYPE n);
extern bool avr_have_dimode;
+namespace gcc { class context; }
+class rtl_opt_pass;
+
+extern rtl_opt_pass *make_avr_pass_recompute_notes (gcc::context *);
+
/* From avr-log.c */
#define avr_dump(...) avr_vdump (NULL, __FUNCTION__, __VA_ARGS__)
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 9cb8106..7310b54 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -295,6 +295,7 @@ avr_to_int_mode (rtx x)
: simplify_gen_subreg (int_mode_for_mode (mode), x, mode, 0);
}
+namespace {
static const pass_data avr_pass_data_recompute_notes =
{
@@ -328,20 +329,12 @@ public:
}
}; // avr_pass_recompute_notes
+} // anon namespace
-static void
-avr_register_passes (void)
+rtl_opt_pass*
+make_avr_pass_recompute_notes (gcc::context *ctxt)
{
- /* This avr-specific pass (re)computes insn notes, in particular REG_DEAD
- notes which are used by `avr.c::reg_unused_after' and branch offset
- computations. These notes must be correct, i.e. there must be no
- dangling REG_DEAD notes; otherwise wrong code might result, cf. PR64331.
-
- DF needs (correct) CFG, hence right before free_cfg is the last
- opportunity to rectify notes. */
-
- register_pass (new avr_pass_recompute_notes (g, "avr-notes-free-cfg"),
- PASS_POS_INSERT_BEFORE, "*free_cfg", 1);
+ return new avr_pass_recompute_notes (ctxt, "avr-notes-free-cfg");
}
@@ -464,11 +457,6 @@ avr_option_override (void)
init_machine_status = avr_init_machine_status;
avr_log_set_avr_log();
-
- /* Register some avr-specific pass(es). There is no canonical place for
- pass registration. This function is convenient. */
-
- avr_register_passes ();
}
/* Function to set up the backend function structure. */
diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr
index 48b7701..ffa5b50 100644
--- a/gcc/config/avr/t-avr
+++ b/gcc/config/avr/t-avr
@@ -16,6 +16,8 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
+PASSES_EXTRA += $(srcdir)/config/avr/avr-passes.def
+
driver-avr.o: $(srcdir)/config/avr/driver-avr.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(srcdir)/config/avr/avr-arch.h $(TM_H)