This is a slightly updated version of the patch sent here:
"[PATCH] Add "__RTL" to cc1 (v7)"
https://gcc.gnu.org/ml/gcc-patches/2016-12/msg01662.html
but split up into smaller parts to (I hope) make review
easier.
Other changes in v8:
- fix copyright years in new files
- split out changes to passes.c; fixups to pass skipping
The set of patches wires up the RTL-reading code into cc1 for
functions tagged with "__RTL" in an analogous manner to those
tagged with "__GIMPLE", and adds a collection of testcases using
this functionality.
One difference from the GIMPLE frontend is that, due to the
pervasive singleton state throughout the RTL code, we can't have
more than one RTL function in memory at once. Hence as soon as
we're done parsing an __RTL-tagged function we have to run the
rest of the passes on it, and emit asm for it, rather than having
the callgraph control this.
Successfully bootstrapped®rtested on x86_64-pc-linux-gnu;
v7 was successfully built for 191 target configurations.
David Malcolm (10):
Add "__RTL" to C frontend
Don't assume that copy tables were initialized
callgraph: handle __RTL functions
Don't call delete_tree_ssa for __RTL functions
Update "startwith" logic for pass-skipping to handle __RTL functions
Add a way for the C frontend to compile __RTL-tagged functions
Extend .md and RTL parsing to support being wired up to cc1
testsuite: add platform-independent files
testsuite: add aarch64-specific files
testsuite: add x86_64-specific files
gcc/Makefile.in | 1 +
gcc/c-family/c-common.c | 1 +
gcc/c-family/c-common.h | 3 +
gcc/c/c-parser.c | 109 ++++++++++++++++-
gcc/c/c-tree.h | 7 +-
gcc/c/gimple-parser.c | 8 +-
gcc/c/gimple-parser.h | 2 +-
gcc/cfg.c | 9 ++
gcc/cfg.h | 1 +
gcc/cfgrtl.c | 3 +-
gcc/cgraph.h | 4 +
gcc/cgraphunit.c | 41 ++++++-
gcc/final.c | 3 +-
gcc/function.h | 2 +-
gcc/gimple-expr.c | 3 +-
gcc/pass_manager.h | 6 +
gcc/passes.c | 65 ++++++++--
gcc/read-md.c | 34 +++++-
gcc/read-md.h | 7 ++
gcc/read-rtl-function.c | 83 ++++++++++---
gcc/read-rtl-function.h | 3 +
gcc/run-rtl-passes.c | 66 ++++++++++
gcc/run-rtl-passes.h | 25 ++++
gcc/testsuite/gcc.dg/rtl/aarch64/asr_div1.c | 41 +++++++
gcc/testsuite/gcc.dg/rtl/aarch64/pr71779.c | 50 ++++++++
gcc/testsuite/gcc.dg/rtl/rtl.exp | 41 +++++++
gcc/testsuite/gcc.dg/rtl/test.c | 31 +++++
gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c | 2 +
gcc/testsuite/gcc.dg/rtl/unknown-rtx-code.c | 8 ++
gcc/testsuite/gcc.dg/rtl/x86_64/dfinit.c | 116 ++++++++++++++++++
.../gcc.dg/rtl/x86_64/different-structs.c | 81 +++++++++++++
gcc/testsuite/gcc.dg/rtl/x86_64/final.c | 133 +++++++++++++++++++++
gcc/testsuite/gcc.dg/rtl/x86_64/into-cfglayout.c | 117 ++++++++++++++++++
gcc/testsuite/gcc.dg/rtl/x86_64/ira.c | 111 +++++++++++++++++
gcc/testsuite/gcc.dg/rtl/x86_64/pro_and_epilogue.c | 110 +++++++++++++++++
.../gcc.dg/rtl/x86_64/test-multiple-fns.c | 105 ++++++++++++++++
.../rtl/x86_64/test-return-const.c.after-expand.c | 39 ++++++
.../rtl/x86_64/test-return-const.c.before-fwprop.c | 42 +++++++
gcc/testsuite/gcc.dg/rtl/x86_64/test-rtl.c | 101 ++++++++++++++++
gcc/testsuite/gcc.dg/rtl/x86_64/test_1.h | 16 +++
.../gcc.dg/rtl/x86_64/times-two.c.after-expand.c | 70 +++++++++++
.../gcc.dg/rtl/x86_64/times-two.c.before-df.c | 54 +++++++++
gcc/testsuite/gcc.dg/rtl/x86_64/times-two.h | 22 ++++
gcc/testsuite/gcc.dg/rtl/x86_64/vregs.c | 112 +++++++++++++++++
44 files changed, 1844 insertions(+), 44 deletions(-)
create mode 100644 gcc/run-rtl-passes.c
create mode 100644 gcc/run-rtl-passes.h
create mode 100644 gcc/testsuite/gcc.dg/rtl/aarch64/asr_div1.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/aarch64/pr71779.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/rtl.exp
create mode 100644 gcc/testsuite/gcc.dg/rtl/test.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/unknown-rtx-code.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/dfinit.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/different-structs.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/final.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/into-cfglayout.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/ira.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/pro_and_epilogue.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/test-multiple-fns.c
create mode 100644
gcc/testsuite/gcc.dg/rtl/x86_64/test-return-const.c.after-expand.c
create mode 100644
gcc/testsuite/gcc.dg/rtl/x86_64/test-return-const.c.before-fwprop.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/test-rtl.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/test_1.h
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/times-two.c.after-expand.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/times-two.c.before-df.c
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/times-two.h
create mode 100644 gcc/testsuite/gcc.dg/rtl/x86_64/vregs.c
--
1.8.5.3