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: [patch] Simplify case labels for mathematical builtins


On 30 Nov, Roger Sayle wrote:

> This is OK for mainline, provided that you move the definitions of
> CASE_FLT_FN and CASE_INT_FN.  I don't think that builtins.def is the
> most appropriate place for them, instead I prefer to see those lines
> moved to tree.h (close to where we #include "builtins.def").  This
> should also avoid to need to #undef them first, as builtins.def may
> be included multiple times in a single source file, but tree.h will
> be included only once.

You're right, tree.h is a better place for the macro definitions,
see patch below.

I'll retest the whole patch and commit it, if testing succeeds.

Regards,
Volker

===================================================================
--- gcc/gcc/tree.h	(revision 107699)
+++ gcc/gcc/tree.h	(working copy)
@@ -234,6 +234,9 @@
 
 #define BUILTIN_ROOT_P(FN) (BUILTIN_SQRT_P (FN) || BUILTIN_CBRT_P (FN))
 
+#define CASE_FLT_FN(FN) case FN: case FN##F: case FN##L
+#define CASE_INT_FN(FN) case FN: case FN##L: case FN##LL
+
 /* An array of _DECL trees for the above.  */
 extern GTY(()) tree built_in_decls[(int) END_BUILTINS];
 extern GTY(()) tree implicit_built_in_decls[(int) END_BUILTINS];
===================================================================



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