This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Move printf and fprintf builtins to middle-end.
On Sun, 20 Jul 2003, Kaveh R. Ghazi wrote:
> On the issue of validating the printf arglist, I had hoped that
> someday we could optimize more cases where we had format specifiers
> with constant args. E.g. printf("%d %d %d\n",1,2,3) could become
> puts("1 2 3"). This would have required using the frontend code to
> validate the arglist but these opts never materialized. I guess we
> could make it a langhook if such a thing was ever written, so I don't
> mind losing this ability.
A key point here being that there are language version dependencies - the
middle-end code should know nothing of flag_isoc99, but you can't optimise
a "%lld" format if (flag_iso && !flag_isoc99).
--
Joseph S. Myers
jsm@polyomino.org.uk