On Wed, 16 Jun 2021, Julian Brown wrote: > > + if test x$gcc_cv_as_gcn_global_load_fixed = xyes; then > > + AC_DEFINE(HAVE_GCN_ASM_GLOBAL_LOAD_FIXED, 1, [Define if your > > assembler has fixed global_load functions.]) > > + else > > + AC_DEFINE(HAVE_GCN_ASM_GLOBAL_LOAD_FIXED, 0, [Define if your > > assembler has fixed global_load functions.]) > > + fi > > + AC_MSG_RESULT($gcc_cv_as_gcn_global_load_fixed) > > + ;; > > +esac > > I think the more-common idiom seems to be just having a single > AC_DEFINE if the feature is present -- like (as a random example) > HAVE_AS_IX86_REP_LOCK_PREFIX, which omits the "define ... 0" case you > have here. (You'd use "#ifdef ..." instead of "#if ... == 1" to check > the feature then, of course).
Actually I think what's preferable is the approach used with e.g. GATHER_STATISTICS - define to 0 or 1 using a single AC_DEFINE_UNQUOTED call (via a shell variable that's set to 0 or 1 as appropriate), then test in "if" conditions, not #if, as far as possible, so that both alternatives in the conditional code always get syntax-checked when compiling GCC (for this target). -- Joseph S. Myers jos...@codesourcery.com