This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug middle-end/21988] GCC should transform printf("%s",foo) and printf("foo") into fputs(foo,stdout)



------- Comment #2 from ghazi at gcc dot gnu dot org  2005-11-28 03:23 -------
Getting stdout wrapped in an inline function is not hard.  I can create
something fixincl or whatever to capture that.  The part I don't know how to do
is expand that inline function's body into the code stream from
fold_builtin_printf or expand_builtin_printf.

Just inserting the inline function call as the right parameter to fputs and
calling expand() used to just magically work when we had the RTL inliner
because that ran after builtin expansion.  Now with the tree inliner it's too
late so we'd have to do something else extra.

Anybody have ideas on this?  It might also help with PR 24729.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21988


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