This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to add __builtin_printf -> fputs transformations
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch to add __builtin_printf -> fputs transformations
- From: Richard Henderson <rth at cygnus dot com>
- Date: Tue, 19 Sep 2000 21:16:20 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200009192213.SAA29091@caip.rutgers.edu>
On Tue, Sep 19, 2000 at 06:13:58PM -0400, Kaveh R. Ghazi wrote:
> The stdio-opt.h instantiates the new __builtin_initialize_stdout
> function which expects one pointer type parameter.
Another alternative is to look for an inline function
static inline FILE * __builtin_stdout(void) { return stdout; }
If it is not defined, then the optimization is not performed.
If it is defined, then you transform to
fputs("string", __builtin_stdout());
Yes, this does require that you do these optimizations in the
front ends and not in builtins.c, but I'm inclined to think
that this would actually be a good thing.
r~