This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: APPEAL to steering committee: [Bug target/23605] memset() Optimization on x86-32 bit
- From: Ian Lance Taylor <ian at airs dot com>
- To: Kevin McBride <kevin at planetsaphire dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 28 Aug 2005 16:29:56 -0700
- Subject: Re: APPEAL to steering committee: [Bug target/23605] memset() Optimization on x86-32 bit
- References: <43123F31.6080309@planetsaphire.com>
Kevin McBride <kevin@planetsaphire.com> writes:
> Please take notice that I am appealing my bug (number 23605) to the
> steering committee of GCC on the basis that it is a legimate
> bug/enhancement in need of a through research. I believe that Andrew
> Pinski is trying to keep the research from occuring by means of marking
> the bug as invalid.
>
> I am hoping that the steering committee will order a through research on
> the bug. There are times when it might be best to have things like
> memset() inlined by the compiler itself, as outlined in my latest
> comment to the bug.
I'm sure we all look forward to receiving orders from the steering
committee.
As pinskia noted, later, in the PR, you want the
-minline-all-stringops option, which is documented.
In the meantime, I think there may be a bug here, in that memset is
open coded for the i386 at -O0. That doesn't make sense to me; e.g.,
it prevents setting a breakpoing on memset. This happens in this
conditional in ix86_expand_clrmem:
if ((!optimize || optimize_size)
&& (count == 0
|| ((count & 0x03)
&& (!optimize_size || (count & 0x03) + (count >> 2) > 7))))
/* do cld; stos */
This conditional dates back to here:
Tue Jan 11 16:26:47 MET 2000 Jan Hubicka <jh@suse.cz>
...
(cld pattern): New.
(movstrsi, clrstr, cmpstr, strlen expander): Emit cld instruction
(movstrsi_1, clrstrsi_1, cmpstrsi_1, strlensi_1,
cmpstrsi_nz_1 insn): Do not output cld instruction
Any thoughts on this?
Ian