This is the mail archive of the gcc-patches@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: Patch to add __builtin_printf -> fputs transformations


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~

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