This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Help restricting args of an intrinsic function
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: Mike Stump <mrs at apple dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>, Syd Polk <spolk at apple dot com>,GCC List <gcc at gcc dot gnu dot org>
- Date: Mon, 2 Feb 2004 15:45:05 -0800
- Subject: Re: Help restricting args of an intrinsic function
- References: <20040202152606.B7898@synopsys.com> <BB5C02CE-55D8-11D8-A1BE-003065A77310@apple.com>
I wrote:
> > Who says that exactly one instruction must be emitted with the
> > optimizer off? It seems to me that it would suffice to have the
> > builtin function emit the one instruction in the case where the mask
> > arguments, after any optimization, are constant, and otherwise emit
> > whatever code is needed to compute the correct result (or simply emit
> > a call to a library function).
On Mon, Feb 02, 2004 at 03:37:15PM -0800, Mike Stump wrote:
> This violates the users expectations.
>
> The _point_ of having builtins for single machine instructions is so
> that the generated code will use them (or something better). Tweaking
> a builtin to generate an external lib call or 5 instructions instead of
> using that one machine instruction isn't, uhm, winning.
So issue a warning, and make the warning suppressible. If you don't,
you'll then be in the position of telling people to use #define instead
of const, and you'll saddle us with a huge stream of additional bugs
(any time the compiler changes in such a way that an expression that
used to be simplified to a constant at -O0 isn't, we get a bug report).