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: Builtins that don't work


In article <9j7i3i$6co$2@clipper.ens.fr> you write:
>But, should we actually try to fix the underlying problem?  Either by
>not recognizing the builtin on platforms that don't have the underlying
>function, or by making the builtin perform the cast and calling `sqrt'?
>I would favor not recognizing the builtin; otherwise, we are subtly
>changing the semantics of the user's program.

Having more control about builtin expansions would be cool. Even at
runtime. Right now, the situation isn't as good as it could be.

If some builtin doesn't work, you have to disable all builtins, and reenable
the builtins you want with -Dxxx=__builtin_xxx. This can be VERY time 
consuming, and it becomes unrealistic when builtins get added.

Now, take the built-in issue the other way around: some builtins are
organized around rewriting rules, and those rewriting rules might be an
issue on some specific cases, because the required functions are not 
available.

Say, you've run into that sqrt problem on that platform. But what about other
similar issues ? The sqrt might not be in the standard library, or the user
may wish to use another library that does not offer sqrtf. Then his only
choice would be to reconfigure and rebuild the compiler to remove that 
dependency ? This doesn't look too palateable right now.

As a matter of fact, I've been running into this problem with gcc 3.0 and
the OpenBSD kernel. Granted, this is a somewhat freestanding situation, BUT
we can benefit from some built-ins. And in reality, the simplest way to
explain to gcc what we need is to tell it to shut off the
printf -> puts and printf -> putchar rewrites.

Or more precisely, to tell it that printf and putchar are not available...
so to restrict itself to other optimizations.

This would be a very useful framework. Right now, builtins are on/off
issues. Do they need to be ?


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