This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/47980] Inefficient code for local const char arrays
- From: "rafael.espindola at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 3 Mar 2011 21:50:11 +0000
- Subject: [Bug c/47980] Inefficient code for local const char arrays
- Auto-submitted: auto-generated
- References: <bug-47980-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47980
--- Comment #2 from Rafael Avila de Espindola <rafael.espindola at gmail dot com> 2011-03-03 21:50:07 UTC ---
I agree that the code is correct. The bug is because of a missing optimization,
not about wrong behavior.
The only use of foo is passing it function expecting a const pointer. Gcc could
remove the copy and just pass a pointer to the global it created to hold the
string.
p.s.: how do I reopen the bug?