aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2018-09-06 07:35:35 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2018-09-06 07:35:35 +0000
commitd7252499463a4fe2c073d8a28c6c0c966e20755f (patch)
treec273449b084c0b8a65a8b15b899d95bf6861bd89 /gcc
parentf0d2063151bddc1ab3cbd178afe3280a68ab76aa (diff)
downloadgcc-d7252499463a4fe2c073d8a28c6c0c966e20755f.zip
gcc-d7252499463a4fe2c073d8a28c6c0c966e20755f.tar.gz
gcc-d7252499463a4fe2c073d8a28c6c0c966e20755f.tar.bz2
S/390: Register pass_s390_early_mach statically
The dump file used to come at the end of the sorted dump file list, because the pass was registered dynamically. This did not reflect the order in which passes are executed. Static registration fixes this: * foo4.c.277r.split2 * foo4.c.281r.early_mach * foo4.c.282r.pro_and_epilogue gcc/ChangeLog: 2018-09-06 Ilya Leoshkevich <iii@linux.ibm.com> PR target/80080 * config/s390/s390-passes.def: New file. * config/s390/s390-protos.h (class rtl_opt_pass): Add forward declaration. (make_pass_s390_early_mach): Add declaration. * config/s390/s390.c (make_pass_s390_early_mach): (s390_option_override): Remove dynamic registration. * config/s390/t-s390: Add s390-passes.def. From-SVN: r264142
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/s390/s390-passes.def20
-rw-r--r--gcc/config/s390/s390-protos.h6
-rw-r--r--gcc/config/s390/s390.c21
-rw-r--r--gcc/config/s390/t-s3901
5 files changed, 44 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f24c52e..31f7778 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2018-09-06 Ilya Leoshkevich <iii@linux.ibm.com>
+ PR target/80080
+ * config/s390/s390-passes.def: New file.
+ * config/s390/s390-protos.h (class rtl_opt_pass): Add forward
+ declaration.
+ (make_pass_s390_early_mach): Add declaration.
+ * config/s390/s390.c (make_pass_s390_early_mach):
+ (s390_option_override): Remove dynamic registration.
+ * config/s390/t-s390: Add s390-passes.def.
+
+2018-09-06 Ilya Leoshkevich <iii@linux.ibm.com>
+
* config/s390/s390.c (s390_decompose_constant_pool_ref):
Remove UNSPEC_LTREL_BASE check.
(annotate_constant_pool_refs): Likewise.
diff --git a/gcc/config/s390/s390-passes.def b/gcc/config/s390/s390-passes.def
new file mode 100644
index 0000000..035c6e8
--- /dev/null
+++ b/gcc/config/s390/s390-passes.def
@@ -0,0 +1,20 @@
+/* Description of target passes for S/390.
+ Copyright (C) 2018 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/>. */
+
+INSERT_PASS_BEFORE (pass_thread_prologue_and_epilogue, 1, pass_s390_early_mach);
diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h
index 46f0743..45fce6c 100644
--- a/gcc/config/s390/s390-protos.h
+++ b/gcc/config/s390/s390-protos.h
@@ -165,3 +165,9 @@ extern void s390_register_target_pragmas (void);
/* Routines for s390-c.c */
extern bool s390_const_operand_ok (tree, int, int, tree);
+
+/* Pass management. */
+namespace gcc { class context; }
+class rtl_opt_pass;
+
+extern rtl_opt_pass *make_pass_s390_early_mach (gcc::context *ctxt);
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 3e183dd..30bf0292 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -10556,6 +10556,12 @@ pass_s390_early_mach::execute (function *fun)
} // anon namespace
+rtl_opt_pass *
+make_pass_s390_early_mach (gcc::context *ctxt)
+{
+ return new pass_s390_early_mach (ctxt);
+}
+
/* Calculate TARGET = REG + OFFSET as s390_emit_prologue would do it.
- push too big immediates to the literal pool and annotate the refs
- emit frame related notes for stack pointer changes. */
@@ -14964,21 +14970,6 @@ s390_option_override (void)
if (!global_options_set.x_dwarf_version)
dwarf_version = 2;
}
-
- /* Register a target-specific optimization-and-lowering pass
- to run immediately before prologue and epilogue generation.
-
- Registering the pass must be done at start up. It's
- convenient to do it here. */
- opt_pass *new_pass = new pass_s390_early_mach (g);
- struct register_pass_info insert_pass_s390_early_mach =
- {
- new_pass, /* pass */
- "pro_and_epilogue", /* reference_pass_name */
- 1, /* ref_pass_instance_number */
- PASS_POS_INSERT_BEFORE /* po_op */
- };
- register_pass (&insert_pass_s390_early_mach);
}
#if S390_USE_TARGET_ATTRIBUTE
diff --git a/gcc/config/s390/t-s390 b/gcc/config/s390/t-s390
index cdea373..8ca0c78 100644
--- a/gcc/config/s390/t-s390
+++ b/gcc/config/s390/t-s390
@@ -18,6 +18,7 @@
TM_H += $(srcdir)/config/s390/s390-builtins.def
TM_H += $(srcdir)/config/s390/s390-builtin-types.def
+PASSES_EXTRA += $(srcdir)/config/s390/s390-passes.def
s390-c.o: $(srcdir)/config/s390/s390-c.c \
$(srcdir)/config/s390/s390-protos.h $(CONFIG_H) $(SYSTEM_H) coretypes.h \