]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/Makefile.in
Check for invalid FAILs
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Dec 2015 09:06:28 +0000 (09:06 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Dec 2015 09:06:28 +0000 (09:06 +0000)
commit592e7d6945e8de8562ca5f52fc5a6362c77d3f42
tree5b44d07d2d4f3d21be039ca6d049269722224bbf
parentec23b36dfb512eb92fc81a78f4ccd7c9b1868ec5
Check for invalid FAILs

This patch makes it a compile-time error for an internal-fn optab
to FAIL.  There are certainly other optabs and patterns besides these
that aren't allowed to fail, but this at least deals with the immediate
point of controversy.

Tested normally on x86_64-linux-gnu.  Also tested by building one
configuration per cpu directory.  arc-elf and pdp11 didn't build
for unrelated reasons, but I checked that insn-emit.o built for
both without error.

gcc/
* Makefile.in (GENSUPPORT_H): New macro.
(build/gensupport.o, build/read-rtl.o, build/genattr.o)
(build/genattr-common.o, build/genattrtab.o, build/genautomata.o)
(build/gencodes.o, build/genconditions.o, build/genconfig.o)
(build/genconstants.o, build/genextract.o, build/genflags.o)
(build/gentarget-def.o): Use it.
(build/genemit.o): Likewise.  Depend on internal-fn.def.
* genopinit.c: Move block comment to optabs.def.
(optab_tag, optab_def): Move to gensupport.h
(pattern): Likewise, renaming to optab_pattern.
(match_pattern): Move to gensupport.c
(gen_insn): Use find_optab.
(patterns, pattern_cmp): Replace pattern with optab_pattern.
(main): Likewise.  Use num_optabs.
* optabs.def: Add comment that was previously in genopinit.c.
* gensupport.h (optab_tag): Moved from genopinit.c
(optab_def): Likewise, expanding commentary.
(optab_pattern): Likewise, after renaming from pattern.
(optabs, num_optabs, find_optab): Declare.
* gensupport.c (optabs): Moved from genopinit.c.
(num_optabs): New variable.
(match_pattern): Moved from genopinit.c.
(find_optab): New function, extracted from genopinit.c:gen_insn.
* genemit.c (nofail_optabs): New variable.
(emit_c_code): New function.
(gen_expand): Check whether the instruction is an optab that isn't
allowed to fail.  Call emit_c_code.
(gen_split): Call emit_c_code here too.
(main): Initialize nofail_optabs.  Don't emit FAIL and DONE here.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231160 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/Makefile.in
gcc/genemit.c
gcc/genopinit.c
gcc/gensupport.c
gcc/gensupport.h
gcc/optabs.def