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 tree-optimization/81776] missing sprintf optimization due to pointer escape analysis


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81776

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
I think GCC needs to avoid performing sprintf optimizations when it sees a
non-standard (i.e., undefined) format conversion (the sprintf pass does).

For Glibc customizations that override standard conversions like %s, the user
needs to explicitly disable the built-in sprintf handling, otherwise the
sprintf -> strcpy or printf -> puts optimizations will defeat them.  Carlos
O'Donell says the Glibc manual should also be updated to make this clear.  To
make it easy to disable all of them (and not forget, say vsnprintf), Carlos
suggests adding a convenience option as an alias for all of
-fno-builtin-{,v}{,f,s,sn}printf and -fno-builtin-{,f}printf-unlocked (at least
I think that's all of them, unless the checking forms also need to be
disabled).

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