This is the mail archive of the gcc@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]

Re: new __builtin_choose_type (patch) (new builtin_equal_types patch)


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


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