public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/23605] memset() Optimization on x86-32 bit
       [not found] <bug-23605-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-11 14:21 ` rguenth at gcc dot gnu.org
  0 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-11 14:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
               Host|Kernel 2.6.12               |
         Resolution|                            |WONTFIX
              Build|-g -O0                      |

--- Comment #18 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-11 14:21:28 UTC ---
Unclear state of this bug.  We likely have newer dups if there is an issue.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
       [not found] <bug-23605-11252@http.gcc.gnu.org/bugzilla/>
  2005-11-02 17:16 ` pinskia at gcc dot gnu dot org
@ 2006-09-18  1:45 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-18  1:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from pinskia at gcc dot gnu dot org  2006-09-18 01:45 -------
(In reply to comment #13)
> Notice in the tektester.386.s testcase, you have an xor instruction on ebx,
> when all what's needed to clear out al/ax/eax is a
> mov  $0, al/ax/eax
xor is both faster and has a smaller encoding than mov does.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
       [not found] <bug-23605-11252@http.gcc.gnu.org/bugzilla/>
@ 2005-11-02 17:16 ` pinskia at gcc dot gnu dot org
  2006-09-18  1:45 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-02 17:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from pinskia at gcc dot gnu dot org  2005-11-02 17:16 -------
All P1 enhancements not targeted towards 4.1, moving to P5.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P5


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
                   ` (11 preceding siblings ...)
  2005-08-29  0:36 ` kevin at planetsaphire dot com
@ 2005-08-29  0:49 ` kevin at planetsaphire dot com
  12 siblings, 0 replies; 16+ messages in thread
From: kevin at planetsaphire dot com @ 2005-08-29  0:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kevin at planetsaphire dot com  2005-08-29 00:36 -------
Also, is setting %eax to $0 once per memset good enough?  I don't think the
"stos" instruction would reset %eax...  the resulting assembly code in
tektester.386.s is the same in -O3 and -O2...

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
                   ` (10 preceding siblings ...)
  2005-08-28 23:42 ` ian at airs dot com
@ 2005-08-29  0:36 ` kevin at planetsaphire dot com
  2005-08-29  0:49 ` kevin at planetsaphire dot com
  12 siblings, 0 replies; 16+ messages in thread
From: kevin at planetsaphire dot com @ 2005-08-29  0:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kevin at planetsaphire dot com  2005-08-29 00:16 -------
err... I meant "get rid of the pushpop instructions for ebx" because ebx
wouldn't be used (probably taken care of automatically anyway)

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
                   ` (9 preceding siblings ...)
  2005-08-28 23:25 ` ian at airs dot com
@ 2005-08-28 23:42 ` ian at airs dot com
  2005-08-29  0:36 ` kevin at planetsaphire dot com
  2005-08-29  0:49 ` kevin at planetsaphire dot com
  12 siblings, 0 replies; 16+ messages in thread
From: ian at airs dot com @ 2005-08-28 23:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ian at airs dot com  2005-08-28 23:36 -------
The generated code for your second test case doesn't look too bad to me.  The
bulk of the code is checking the alignment of the buffer in order to get an
efficient rep; stosl.  What would you recommend as faster code?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
                   ` (8 preceding siblings ...)
  2005-08-28 23:03 ` pinskia at gcc dot gnu dot org
@ 2005-08-28 23:25 ` ian at airs dot com
  2005-08-28 23:42 ` ian at airs dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: ian at airs dot com @ 2005-08-28 23:25 UTC (permalink / raw)
  To: gcc-bugs


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
                   ` (7 preceding siblings ...)
  2005-08-28 23:00 ` pinskia at gcc dot gnu dot org
@ 2005-08-28 23:03 ` pinskia at gcc dot gnu dot org
  2005-08-28 23:25 ` ian at airs dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-28 23:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-28 23:00 -------
Oh, I forgot to mention if you want to inline all string functions, use -minline-all-stringops.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
                   ` (6 preceding siblings ...)
  2005-08-28 22:18 ` kevin at planetsaphire dot com
@ 2005-08-28 23:00 ` pinskia at gcc dot gnu dot org
  2005-08-28 23:03 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-28 23:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-28 22:21 -------
First it is not our bug your distro installs i686 versions, go bug them instead.
Second glibc not using SSE is its bug and not ours, report it to them instead.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
                   ` (5 preceding siblings ...)
  2005-08-28 20:45 ` pinskia at gcc dot gnu dot org
@ 2005-08-28 22:18 ` kevin at planetsaphire dot com
  2005-08-28 23:00 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: kevin at planetsaphire dot com @ 2005-08-28 22:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kevin at planetsaphire dot com  2005-08-28 21:58 -------
(In reply to comment #6)
> inlining memset is not an optimization as most OS's memsets are better than
the inlined version, using 
> sse registers,etc.

I have finished reviewing over the glibc memset.* source files for the 32-bit
Intel platforms, simply because every one using Linux is using glibc as the
"libc".  I find that SSE (nor even MMX) is used in the 32-bit implementations of
memset.

I think it is best to change this bug into an enhancement for the next available
GCC branch.  The reason for this change is because of a few reasons:

1. Fedora Core 3 (the distro installed on my computer) does not install the i686
binaries of glibc during install; rather, it installs the i386 version.

2. You are right about systems having better memset()s, though considering the
widespread use of glibc, most implementations do not utilize SSE, MMX, etc. 
Maybe the memset() optimization can be turned on by the use of a new flag? 
After all, the i386 build of glibc does not include the use of instructions that
can possibly be used on i686.  In addition, there may be a few circumstances
where the user may not want to use the i686 build, such as debugging, apps that
require the i386 build (perhaps to get around a few glibc bugs), and hardware
processor issues with other functions in glibc.

I hope the GCC staff and the steering committee reviews over this possible
enhancement seriously.  The optimization would allow the user to get around
slower code in certain situations when it comes to using memset().

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |enhancement
             Status|RESOLVED                    |UNCONFIRMED
           Priority|P2                          |P1
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
                   ` (4 preceding siblings ...)
  2005-08-28 20:37 ` kevin at planetsaphire dot com
@ 2005-08-28 20:45 ` pinskia at gcc dot gnu dot org
  2005-08-28 22:18 ` kevin at planetsaphire dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-28 20:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-28 20:37 -------
inlining memset is not an optimization as most OS's memsets are better than the inlined version, using 
sse registers,etc.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
                   ` (3 preceding siblings ...)
  2005-08-28 20:34 ` pinskia at gcc dot gnu dot org
@ 2005-08-28 20:37 ` kevin at planetsaphire dot com
  2005-08-28 20:45 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: kevin at planetsaphire dot com @ 2005-08-28 20:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kevin at planetsaphire dot com  2005-08-28 20:34 -------
(In reply to comment #4)
> You are compiling at -O0 so this is not a bug and we don't care that much
about code generation at 
> -O0.

So you're invalidating this bug because -O0 optimizes this and -O2 does not?  I
think this is clearly a bug, and so does Ian Lance Taylor per his e-mail earlier.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
                   ` (2 preceding siblings ...)
  2005-08-28 20:28 ` kevin at planetsaphire dot com
@ 2005-08-28 20:34 ` pinskia at gcc dot gnu dot org
  2005-08-28 20:37 ` kevin at planetsaphire dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-28 20:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-28 20:28 -------
You are compiling at -O0 so this is not a bug and we don't care that much about code generation at 
-O0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
  2005-08-28 20:16 ` [Bug target/23605] " pinskia at gcc dot gnu dot org
  2005-08-28 20:26 ` kevin at planetsaphire dot com
@ 2005-08-28 20:28 ` kevin at planetsaphire dot com
  2005-08-28 20:34 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: kevin at planetsaphire dot com @ 2005-08-28 20:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kevin at planetsaphire dot com  2005-08-28 20:26 -------
(In reply to comment #1)
> Are you compiling your source at -O0 or GCC at -O0?  If the former, then this
is most likely not a bug.

-O2 does not do any optimization at all, and -O0 optimizes the code to a certain
extent.  The testcase I submitted was compiled with the -O0 flag.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
  2005-08-28 20:16 ` [Bug target/23605] " pinskia at gcc dot gnu dot org
@ 2005-08-28 20:26 ` kevin at planetsaphire dot com
  2005-08-28 20:28 ` kevin at planetsaphire dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: kevin at planetsaphire dot com @ 2005-08-28 20:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kevin at planetsaphire dot com  2005-08-28 20:18 -------
Created an attachment (id=9604)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9604&action=view)
Testcases and .i Files of uchar.*

This attatchment contains only the source files of my project, as well as the
.i files of uchar.*

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug target/23605] memset() Optimization on x86-32 bit
  2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
@ 2005-08-28 20:16 ` pinskia at gcc dot gnu dot org
  2005-08-28 20:26 ` kevin at planetsaphire dot com
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-28 20:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-28 20:08 -------
Are you compiling your source at -O0 or GCC at -O0?  If the former, then this is most likely not a bug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23605


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-01-11 14:21 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-23605-4@http.gcc.gnu.org/bugzilla/>
2012-01-11 14:21 ` [Bug target/23605] memset() Optimization on x86-32 bit rguenth at gcc dot gnu.org
     [not found] <bug-23605-11252@http.gcc.gnu.org/bugzilla/>
2005-11-02 17:16 ` pinskia at gcc dot gnu dot org
2006-09-18  1:45 ` pinskia at gcc dot gnu dot org
2005-08-28 20:08 [Bug c/23605] New: " kevin at planetsaphire dot com
2005-08-28 20:16 ` [Bug target/23605] " pinskia at gcc dot gnu dot org
2005-08-28 20:26 ` kevin at planetsaphire dot com
2005-08-28 20:28 ` kevin at planetsaphire dot com
2005-08-28 20:34 ` pinskia at gcc dot gnu dot org
2005-08-28 20:37 ` kevin at planetsaphire dot com
2005-08-28 20:45 ` pinskia at gcc dot gnu dot org
2005-08-28 22:18 ` kevin at planetsaphire dot com
2005-08-28 23:00 ` pinskia at gcc dot gnu dot org
2005-08-28 23:03 ` pinskia at gcc dot gnu dot org
2005-08-28 23:25 ` ian at airs dot com
2005-08-28 23:42 ` ian at airs dot com
2005-08-29  0:36 ` kevin at planetsaphire dot com
2005-08-29  0:49 ` kevin at planetsaphire dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).