This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/25609] too agressive printf optimization
- From: "gustavodn at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jan 2008 21:08:31 -0000
- Subject: [Bug rtl-optimization/25609] too agressive printf optimization
- References: <bug-25609-700@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #19 from gustavodn at gmail dot com 2008-01-15 21:08 -------
(In reply to comment #17)
> This will be fixed yesterday if printf("%s\n", s) were equivalent to puts(s) in
> glibc.
[+] The standard requires them to be equivalent? Per standard, they can't be
equivalent if both are undefined when NULL is passed, right?
> Also there is a way to disable the optimization: "-fno-builtin-printf".
>
> People that don't rely on undefined behaviour don't deserve to be punished with
> suboptimal code.
It is not undefined, per glibc. GCC is defining undefined behavior, just as
much as glibc, to optimize, that should be documented or fixed.
(In reply to comment #18)
> There is an explanation for the optimisation, a potential fix [*] and there is
> a workaround.
>
> [*] http://sourceware.org/bugzilla/show_bug.cgi?id=5618
[+]
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25609