This is the mail archive of the
mailing list for the GCC project.
Re: Builtins that don't work
- To: mark at codesourcery dot com
- Subject: Re: Builtins that don't work
- From: Marc Espie <espie at quatramaran dot ens dot fr>
- Date: Thu, 2 Aug 2001 03:25:16 +0200
- Cc: gcc at gcc dot gnu dot org
- Organization: Ecole Normale Superieure (quatramaran)
In article <firstname.lastname@example.org> 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
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 ?