This is the mail archive of the 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 for builtin fputs (first stdio opt ready for install)

 > From: Jason Merrill <>
 > You could save a pointer to the _DECL for __builtin_fputc in
 > c_common_nodes_and_builtins.
 > Or you could just use emit_library_call and dispense with the _DECL
 > entirely; that's probably the easiest solution.
 >  > Future optimizations will require expanding into other builtins,
 >  > regular libc calls and inline functions we'll declare behind the
 >  > scenes.  This is why I felt the get_decl mechanism was useful as a
 >  > generic way to get info out of language dependent tree structures.
 > Jason

If I use emit_library_call(), then further opts won't get done
recursively, because it'll actually emit the call rather than lookup
other possible builtins right?

E.g. long term I want this to work:
fprintf("\n") -> fputs("\n") -> fputc('\n') -> putc_macro ('\n')

However, builtin_function() returns the _DECL, so you're right I could
cache it as long as every optimization I'd want to do involved calling
some other builtin which I declare and save.  This'll handle most of
what I want I think.  I'll try it out and see what happens.

Kaveh R. Ghazi			Engagement Manager / Project Services		Qwest Internet Solutions

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