On Wed, Jun 10, 2015 at 07:28:10AM +0300, Mikhail Maltsev wrote: > Hi, all. > > I noticed that defaults.h file contains stub generator functions which > simply call gcc_unreachable. FWIW, Trevor added them to remove some > conditional compilation which depends on HAVE_<insn_name> macros (I mean > something like r223624). > > Because we still have ~80 more such conditions in GCC, and probably some > of them will be fixed in the same way, I propose a patch, which allows > to generate required stubs in genflags.
yeah, I've been meaning to do this, thanks for taking care of it. My plan had been to do it after all the defaults had been added, but if you can do it now great. See https://github.com/tbsaunde/gcc/tree/ifdef for the patches I have in this area, unfortunately I don't expect to commit any of that till july when I get back from travel. > diff --git a/gcc/genflags.c b/gcc/genflags.c > index 0da15f1..2a70b56 100644 > --- a/gcc/genflags.c > +++ b/gcc/genflags.c > @@ -26,10 +26,65 @@ along with GCC; see the file COPYING3. If not see > #include "tm.h" > #include "rtl.h" > #include "obstack.h" > +#include "hash-map.h" > #include "errors.h" > #include "read-md.h" > #include "gensupport.h" > > +/* Structure which holds data, required for generating stub gen_* function. > */ > +struct stub_info_t > +{ > + /* Instruction name. */ > + const char *name; > + /* Number of arguments (i.e., instruction operands). */ > + int opno; unsigned? > + /* Set to true when generator is output, so no stub is needed. */ > + bool done; > +}; > + > +/* These instructions require default stub function. Stubs are never called. are the ones that don't call gcc_unreachable () called? > +/* Print out a dummy for generator for instruction NAME with NUM arguments > + which either does nothing, or aborts (depending on UNREACHABLE). */ I believe you should drop the first "for" in this sentence. Trev