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


> These are reserved functions (7.26.1), not functions defined by C99.  So
> they shouldn't be DEF_C99_BUILTIN; DEF_EXT_C99RES_BUILTIN, similar to
> DEF_C99_C90RES_BUILTIN for names reserved in C90 and added in C99, would
> be more appropriate.

Well, I tried to implement this idea. Is that new patch OK?

FX
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:31:09 -0000
@@ -117,6 +117,13 @@ Software Foundation, 51 Franklin Street,
 #undef DEF_C99_C90RES_BUILTIN					
 #define DEF_C99_C90RES_BUILTIN(ENUM, NAME, TYPE, ATTRS)	\
   DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,	\
+   	       true, true, true, 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, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS, true)
 
 /* Allocate the enum and the name for a builtin, but do not actually
@@ -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_C99_BUILTIN        (BUILT_IN_CLOG10, "clog10", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN        (BUILT_IN_CLOG10F, "clog10f", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
+DEF_C99_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]