aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-11-20 09:57:34 +0100
committerJakub Jelinek <jakub@redhat.com>2023-11-20 09:57:34 +0100
commit99fad213d5d457162be00d873cd655fe402ca91a (patch)
treebb73c27508d08beebd98ef43edbd9bb5514835aa
parent4b51c7c9131280edd1c97053e2b07a33ec0b5501 (diff)
downloadgcc-99fad213d5d457162be00d873cd655fe402ca91a.zip
gcc-99fad213d5d457162be00d873cd655fe402ca91a.tar.gz
gcc-99fad213d5d457162be00d873cd655fe402ca91a.tar.bz2
internal-fn: Always undefine DEF_INTERNAL* macros at the end of internal-fn.def
I have noticed we are inconsistent, some DEF_INTERNAL* macros (most of them) were undefined at the end of internal-fn.def (but in some cases uselessly undefined again after inclusion), while others were not (and sometimes undefined after the inclusion). I've changed it to always undefine at the end of internal-fn.def. 2023-11-20 Jakub Jelinek <jakub@redhat.com> * internal-fn.def: Document missing DEF_INTERNAL* macros and make sure they are all undefined at the end. * internal-fn.cc (lookup_hilo_internal_fn, lookup_evenodd_internal_fn, widening_fn_p, get_len_internal_fn): Don't undef DEF_INTERNAL_*FN macros after inclusion of internal-fn.def.
-rw-r--r--gcc/internal-fn.cc16
-rw-r--r--gcc/internal-fn.def6
2 files changed, 6 insertions, 16 deletions
diff --git a/gcc/internal-fn.cc b/gcc/internal-fn.cc
index 5a998e7..cd46875 100644
--- a/gcc/internal-fn.cc
+++ b/gcc/internal-fn.cc
@@ -102,8 +102,6 @@ lookup_hilo_internal_fn (internal_fn ifn, internal_fn *lo, internal_fn *hi)
{
default:
gcc_unreachable ();
-#undef DEF_INTERNAL_FN
-#undef DEF_INTERNAL_WIDENING_OPTAB_FN
#define DEF_INTERNAL_FN(NAME, FLAGS, TYPE)
#define DEF_INTERNAL_WIDENING_OPTAB_FN(NAME, F, S, SO, UO, T) \
case IFN_##NAME: \
@@ -111,8 +109,6 @@ lookup_hilo_internal_fn (internal_fn ifn, internal_fn *lo, internal_fn *hi)
*hi = internal_fn (IFN_##NAME##_HI); \
break;
#include "internal-fn.def"
-#undef DEF_INTERNAL_FN
-#undef DEF_INTERNAL_WIDENING_OPTAB_FN
}
}
@@ -129,8 +125,6 @@ lookup_evenodd_internal_fn (internal_fn ifn, internal_fn *even,
{
default:
gcc_unreachable ();
-#undef DEF_INTERNAL_FN
-#undef DEF_INTERNAL_WIDENING_OPTAB_FN
#define DEF_INTERNAL_FN(NAME, FLAGS, TYPE)
#define DEF_INTERNAL_WIDENING_OPTAB_FN(NAME, F, S, SO, UO, T) \
case IFN_##NAME: \
@@ -138,8 +132,6 @@ lookup_evenodd_internal_fn (internal_fn ifn, internal_fn *even,
*odd = internal_fn (IFN_##NAME##_ODD); \
break;
#include "internal-fn.def"
-#undef DEF_INTERNAL_FN
-#undef DEF_INTERNAL_WIDENING_OPTAB_FN
}
}
@@ -4261,7 +4253,6 @@ widening_fn_p (code_helper code)
internal_fn fn = as_internal_fn ((combined_fn) code);
switch (fn)
{
- #undef DEF_INTERNAL_WIDENING_OPTAB_FN
#define DEF_INTERNAL_WIDENING_OPTAB_FN(NAME, F, S, SO, UO, T) \
case IFN_##NAME: \
case IFN_##NAME##_HI: \
@@ -4270,7 +4261,6 @@ widening_fn_p (code_helper code)
case IFN_##NAME##_ODD: \
return true;
#include "internal-fn.def"
- #undef DEF_INTERNAL_WIDENING_OPTAB_FN
default:
return false;
@@ -4305,8 +4295,6 @@ set_edom_supported_p (void)
expand_##TYPE##_optab_fn (fn, stmt, which_optab); \
}
#include "internal-fn.def"
-#undef DEF_INTERNAL_OPTAB_FN
-#undef DEF_INTERNAL_SIGNED_OPTAB_FN
/* Routines to expand each internal function, indexed by function number.
Each routine has the prototype:
@@ -4465,8 +4453,6 @@ get_len_internal_fn (internal_fn fn)
{
switch (fn)
{
-#undef DEF_INTERNAL_COND_FN
-#undef DEF_INTERNAL_SIGNED_COND_FN
#define DEF_INTERNAL_COND_FN(NAME, ...) \
case IFN_COND_##NAME: \
return IFN_COND_LEN_##NAME;
@@ -4474,8 +4460,6 @@ get_len_internal_fn (internal_fn fn)
case IFN_COND_##NAME: \
return IFN_COND_LEN_##NAME;
#include "internal-fn.def"
-#undef DEF_INTERNAL_COND_FN
-#undef DEF_INTERNAL_SIGNED_COND_FN
default:
return IFN_LAST;
}
diff --git a/gcc/internal-fn.def b/gcc/internal-fn.def
index 3d5aca0..d645075 100644
--- a/gcc/internal-fn.def
+++ b/gcc/internal-fn.def
@@ -33,9 +33,12 @@ along with GCC; see the file COPYING3. If not see
DEF_INTERNAL_SIGNED_OPTAB_FN (NAME, FLAGS, SELECTOR, SIGNED_OPTAB,
UNSIGNED_OPTAB, TYPE)
DEF_INTERNAL_FLT_FN (NAME, FLAGS, OPTAB, TYPE)
+ DEF_INTERNAL_FLT_FLOATN_FN (NAME, FLAGS, OPTAB, TYPE)
DEF_INTERNAL_INT_FN (NAME, FLAGS, OPTAB, TYPE)
DEF_INTERNAL_COND_FN (NAME, FLAGS, OPTAB, TYPE)
DEF_INTERNAL_SIGNED_COND_FN (NAME, FLAGS, OPTAB, TYPE)
+ DEF_INTERNAL_WIDENING_OPTAB_FN (NAME, FLAGS, SELECTOR, SOPTAB, UOPTAB,
+ TYPE)
where NAME is the name of the function, FLAGS is a set of
ECF_* flags and FNSPEC is a string describing functions fnspec.
@@ -572,6 +575,9 @@ DEF_INTERNAL_FN (DIVMODBITINT, ECF_LEAF, ". O . O . R . R . ")
DEF_INTERNAL_FN (FLOATTOBITINT, ECF_LEAF | ECF_NOTHROW, ". O . . ")
DEF_INTERNAL_FN (BITINTTOFLOAT, ECF_PURE | ECF_LEAF, ". R . ")
+#undef DEF_INTERNAL_WIDENING_OPTAB_FN
+#undef DEF_INTERNAL_SIGNED_COND_FN
+#undef DEF_INTERNAL_COND_FN
#undef DEF_INTERNAL_INT_FN
#undef DEF_INTERNAL_FLT_FN
#undef DEF_INTERNAL_FLT_FLOATN_FN