public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/27055] Structures are copied byte by byte into function arguments
       [not found] <bug-27055-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-15  4:13 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-15  4:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27055

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |4.4.0
         Resolution|---                         |FIXED

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Been fixed at least since 4.4.0:
        movl    %esp, %edi
        rep movsl

Maybe even earlier.

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

* [Bug target/27055] Structures are copied byte by byte into function arguments
  2006-04-06 11:46 [Bug c/27055] New: " guillaume dot melquiond at ens-lyon dot fr
  2006-04-13  1:52 ` [Bug target/27055] " pinskia at gcc dot gnu dot org
@ 2006-04-16 18:16 ` guillaume dot melquiond at ens-lyon dot fr
  1 sibling, 0 replies; 3+ messages in thread
From: guillaume dot melquiond at ens-lyon dot fr @ 2006-04-16 18:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from guillaume dot melquiond at ens-lyon dot fr  2006-04-16 18:15 -------
I have tried to look at why it fails. Here are my observations. The function
gcc/expr.c:emit_block_move tries to expand a movmem pattern. The backend
refuses, since a call to memcpy would be a lot more efficient. So
emit_block_move tries to generate memcpy but
block_move_libcall_safe_for_call_parm says this is not safe. The only thing
left is calling emit_block_move_via_loop, and it generates some really dumb
code.

Whenever there is -Os or -mtune=i386 or -mregparm=3, the function
block_move_libcall_safe_for_call_parm says memcpy is safe. Otherwise it fails
because arguments are neither pushed nor passed through registers but stored at
the top of the stack. Failing then seems to be the right thing to do, since the
call to memcpy will otherwise overwrite its own argument stack.

Assuming memcpy is the right thing to do, emit_block_move should allocate a bit
of stack space for memcpy instead of refusing to call it (and hence falling
back to a loop move).


-- 


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


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

* [Bug target/27055] Structures are copied byte by byte into function arguments
  2006-04-06 11:46 [Bug c/27055] New: " guillaume dot melquiond at ens-lyon dot fr
@ 2006-04-13  1:52 ` pinskia at gcc dot gnu dot org
  2006-04-16 18:16 ` guillaume dot melquiond at ens-lyon dot fr
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-13  1:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-04-13 01:52 -------
This works on most targets I tried, ppc-linux-gnu and x86_64-linux-gnu both
work, only i?86-linux-gnu (32bit) did not.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|middle-end                  |target
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-04-13 01:52:19
               date|                            |


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


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

end of thread, other threads:[~2021-08-15  4:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-27055-4@http.gcc.gnu.org/bugzilla/>
2021-08-15  4:13 ` [Bug target/27055] Structures are copied byte by byte into function arguments pinskia at gcc dot gnu.org
2006-04-06 11:46 [Bug c/27055] New: " guillaume dot melquiond at ens-lyon dot fr
2006-04-13  1:52 ` [Bug target/27055] " pinskia at gcc dot gnu dot org
2006-04-16 18:16 ` guillaume dot melquiond at ens-lyon dot fr

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