This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ping / update: RFA: replace #ifdef with if/#if for HAVE_ATTR_*


I can't approve the whole thing of course, but I like the idea.
However...

Joern Rennecke <joern.rennecke@embecosm.com> writes:
> +@deftypevr {Target Hook} bool TARGET_HAVE_CC0
> +@deftypevrx {Target Hook} {bool} TARGET_AUTO_INC_DEC
> +@deftypevrx {Target Hook} {bool} TARGET_STACK_REGS
> +@deftypevrx {Target Hook} {bool} TARGET_HAVE_ATTR_ENABLED
> +@deftypevrx {Target Hook} {bool} TARGET_HAVE_ATTR_LENGTH
> +These flags are automatically generated;  you should not override them in @file{tm.c}.
> +@end deftypevr

Unless this goes against something already discussed, I think it'd be
better to leave these out until there's a concerted attempt to use them
somewhere.  On its own this isn't even a partial transition. :-)

> +  /* We make an exception here to provide stub definitions for
> +     insn_*_length* / get_attr_enabled functions.  */
> +  puts ("#if !HAVE_ATTR_length\n"
> +	"extern int hook_int_rtx_0 (rtx);\n"
> +	"#define insn_default_length hook_int_rtx_0\n"
> +	"#define insn_min_length hook_int_rtx_0\n"
> +	"#define insn_variable_length_p hook_int_rtx_0\n"
> +	"#define insn_current_length hook_int_rtx_0\n"
> +	"#include \"insn-addr.h\"\n"
> +	"#endif\n"

I'd prefer defaults that call gcc_unreachable, rather than silently
return an arbitrary value.  That said,

> +	"#if !HAVE_ATTR_enabled\n"
> +	"extern int hook_int_rtx_1 (rtx);\n"
> +	"#define get_attr_enabled hook_int_rtx_1\n"
> +	"#endif\n");

I agree that 1 is a safe default here.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]