This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/23605] memset() Optimization on x86-32 bit
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Aug 2005 23:15:38 -0000
- Subject: [Bug target/23605] memset() Optimization on x86-32 bit
- References: <20050828200424.23605.kevin@planetsaphire.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From ian at airs dot com 2005-08-28 23:15 -------
I didn't realize that this was at -O0. Extra register moves at -O0 are not a
bug. -O0 means no optimization.
I think it is odd that we open code memset at -O0 but not at -O1. I don't know
the rationale behind that. The comment in the code explaining why we don't open
code this case by default is:
/* In case we don't know anything about the alignment, default to
library version, since it is usually equally fast and result in
shorter code.
But that does not explain why we open code at -O0. I think the open coding at
-O0 is most likely a bug, as -O0 code should emphasize debuggability, and open
coding prevents the user from setting a breakpoint.
As pinskia says, the -minline-all-stringops option forces the call to be
opencoded. And I agree with him that the bug report about extra register moves
at -O0 is invalid. If you want optimal code, compile with optimization.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605