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: Add clog10 to builtins.def


> This patch seems to be changing the definition of DEF_C99_C90RES_BUILTIN:
> changing the NONANSI_P from !flag_isoc99 to true.

Well, I messed up.

> There are two consistent options: either DEF_C99_C90RES_BUILTIN has
> !flag_isoc99 for NONANSI_P and DEF_EXT_C99RES_BUILTIN has true for
> NONANSI_P

That is what I meant to do. Attached patch is corrected. But I'm not
sure about the last but one field, set to TARGET_C99_FUNCTIONS. Looks
suspicious to me, though I couldn't understand it... comment at the
beginning of builtins.def mentions only 10 arguments for the
BEF_BUILTIN macro :(

Is this patch OK?
Index: gcc/builtins.def
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/builtins.def,v
retrieving revision 1.104
diff -u -3 -p -r1.104 builtins.def
--- gcc/builtins.def	25 Jun 2005 01:59:13 -0000	1.104
+++ gcc/builtins.def	29 Jun 2005 20:57:10 -0000
@@ -119,6 +119,13 @@ Software Foundation, 51 Franklin Street,
   DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,	\
    	       true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS, true)
 
+/* Builtin that C99 reserve the name for future use. We can still recognize
+   the builtin in C99 mode but we can't produce it implicitly.  */
+#undef DEF_EXT_C99RES_BUILTIN					
+#define DEF_EXT_C99RES_BUILTIN(ENUM, NAME, TYPE, ATTRS)	\
+  DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,	\
+   	       true, true, true, ATTRS, TARGET_C99_FUNCTIONS, true)
+
 /* Allocate the enum and the name for a builtin, but do not actually
    define it here at all.  */
 #undef DEF_BUILTIN_STUB
@@ -436,6 +443,9 @@ DEF_C99_BUILTIN        (BUILT_IN_CIMAGL,
 DEF_C99_BUILTIN        (BUILT_IN_CLOG, "clog", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
 DEF_C99_BUILTIN        (BUILT_IN_CLOGF, "clogf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
 DEF_C99_BUILTIN        (BUILT_IN_CLOGL, "clogl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_EXT_C99RES_BUILTIN (BUILT_IN_CLOG10, "clog10", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_EXT_C99RES_BUILTIN (BUILT_IN_CLOG10F, "clog10f", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_EXT_C99RES_BUILTIN (BUILT_IN_CLOG10L, "clog10l", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
 DEF_C99_BUILTIN        (BUILT_IN_CONJ, "conj", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LIST)
 DEF_C99_BUILTIN        (BUILT_IN_CONJF, "conjf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LIST)
 DEF_C99_BUILTIN        (BUILT_IN_CONJL, "conjl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)

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