This is the mail archive of the
mailing list for the GCC project.
[Bug middle-end/21988] GCC should transform printf("%s",foo) and printf("foo") into fputs(foo,stdout)
- From: "ghazi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Nov 2005 03:23:57 -0000
- Subject: [Bug middle-end/21988] GCC should transform printf("%s",foo) and printf("foo") into fputs(foo,stdout)
- References: <firstname.lastname@example.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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.