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 target/23605] memset() Optimization on x86-32 bit


------- 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


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