Commit d7252499 by Ilya Leoshkevich Committed by Andreas Krebbel

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
parent f0d20631
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.
......
/* 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);
......@@ -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);
......@@ -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
......
......@@ -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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment