This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: new __builtin_choose_type (patch) (new builtin_equal_types patch)
- To: Aldy Hernandez <aldyh at redhat dot com>
- Subject: Re: new __builtin_choose_type (patch) (new builtin_equal_types patch)
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Mon, 8 Oct 2001 01:06:41 +0100 (BST)
- cc: Jakub Jelinek <jakub at redhat dot com>, <gcc at gcc dot gnu dot org>
On 7 Oct 2001, Aldy Hernandez wrote:
> So C is a constant? If so, is the following patch what is needed for
> __buildin_choose_expr?
Except that:
* C is an *integer constant expression*, not necessarily a literal
constant. (For example, it might be the return value of
__builtin_types_compatible_p.)
* An implementation for C++ is also needed.
* You should probably wait for the new C++ parser to be merged to the
mainline before doing this, since that will allow you to ignore errors and
warnings in the unused branch, per RTH's comments and my reply to them.
* To use this for type-generic functions, the __builtin_choose_expr goes
together with __builtin_types_compatible_p which needs implementing as
well.
* The actual patch submitted for inclusion in GCC should come with a
corresponding patch to glibc's <tgmath.h> that makes it a lot simpler and
more comprehensible (in the case of a new compiler) and passes glibc's
testsuite, as a sanity check that the proposed built-ins are useful for
their intended purpose.
--
Joseph S. Myers
jsm28@cam.ac.uk