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)


On Wed, 2001-10-03 at 04:15, Magnus Fromreide wrote:
> It is my feeling that it would be more general and cleaner to do something
> along the lines of
> 
> _Bool __builtin_equal_types(arg|type, arg|type)
> 
> that doesn't evaluate the arguments if they are expressions and answers
> the question of wether they are of the same type.
> 

yeah, but i was hoping the calculations could all be done before code
generation.

> Usage examples:
> 
> __builtin_equal_types(x, y) ? no() : x = 10;
> if(__builtin_equal_types(x, y))
>   {
>   }
> else
>   {
>   }

then we'd have to generate:

   if (const)
     {
     }
     etc

whereas with my approach, you wouldn't even have to generate a compare.

> 
> The part i react most against is that it implements a new code path
> selection mechanism that is unlike all previously seen in C.

exactly.

but your approach sounds much simpler though.  i'm going to add some new
functionality to builtins to get my stuff to work.

patch later today...


-- 
Aldy Hernandez					E-mail: aldyh@redhat.com
Professional Gypsy on a Motorcycle
Red Hat, Inc.


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