public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/17237] New: inefficient parameter passing on x86
@ 2004-08-30  5:58 dann at godzilla dot ics dot uci dot edu
  2004-10-06 23:36 ` [Bug rtl-optimization/17237] " giovannibajo at libero dot it
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2004-08-30  5:58 UTC (permalink / raw)
  To: gcc-bugs

Compiling:
unsigned long long LLD(unsigned long long arg1, unsigned long long arg2)
{
  return arg1 /  arg2;
}

with gcc -O2 -fomit-frame-pointer generates:
        subl    $28, %esp
        movl    40(%esp), %eax
        movl    44(%esp), %edx
        movl    %eax, 8(%esp)
        movl    32(%esp), %eax
        movl    %edx, 12(%esp)
        movl    36(%esp), %edx
        movl    %eax, (%esp)
        movl    %edx, 4(%esp)
        call    __udivdi3
        addl    $28, %esp
        ret

which is 48 bytes.

The ICC generated code is 28 bytes:

        pushl     16(%esp)                                      #521.17
        pushl     16(%esp)                                      #521.17
        pushl     16(%esp)                                      #521.17
        pushl     16(%esp)                                      #521.17
        call      __udivdi3                                     #521.17
        addl      $16, %esp                                     #521.17
        ret                                                     #521.17

-- 
           Summary: inefficient parameter passing on x86
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug rtl-optimization/17237] inefficient parameter passing on x86
  2004-08-30  5:58 [Bug rtl-optimization/17237] New: inefficient parameter passing on x86 dann at godzilla dot ics dot uci dot edu
@ 2004-10-06 23:36 ` giovannibajo at libero dot it
  2004-10-07  0:05 ` dann at godzilla dot ics dot uci dot edu
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-10-06 23:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-10-06 23:36 -------
I cannot reproduce this with a recent mainline, 3.4 or 3.3. Looks like this is 
fixed already.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at libero dot
                   |                            |it
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WORKSFORME


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


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

* [Bug rtl-optimization/17237] inefficient parameter passing on x86
  2004-08-30  5:58 [Bug rtl-optimization/17237] New: inefficient parameter passing on x86 dann at godzilla dot ics dot uci dot edu
  2004-10-06 23:36 ` [Bug rtl-optimization/17237] " giovannibajo at libero dot it
@ 2004-10-07  0:05 ` dann at godzilla dot ics dot uci dot edu
  2004-10-07  0:26 ` [Bug rtl-optimization/17237] inefficient parameter passing on x86 (useless stack space allocated) giovannibajo at libero dot it
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2004-10-07  0:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dann at godzilla dot ics dot uci dot edu  2004-10-07 00:05 -------
With a 1 week old mainline I get:
LLD:
	subl	$12, %esp
	pushl	28(%esp)
	pushl	28(%esp)
	pushl	28(%esp)
	pushl	28(%esp)
	call	__udivdi3
	addl	$28, %esp
	ret

i.e. better than before, but the "subl" instruction is not needed.


-- 


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


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

* [Bug rtl-optimization/17237] inefficient parameter passing on x86 (useless stack space allocated)
  2004-08-30  5:58 [Bug rtl-optimization/17237] New: inefficient parameter passing on x86 dann at godzilla dot ics dot uci dot edu
  2004-10-06 23:36 ` [Bug rtl-optimization/17237] " giovannibajo at libero dot it
  2004-10-07  0:05 ` dann at godzilla dot ics dot uci dot edu
@ 2004-10-07  0:26 ` giovannibajo at libero dot it
  2004-10-07  0:26 ` [Bug rtl-optimization/17237] inefficient parameter passing on x86 giovannibajo at libero dot it
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-10-07  0:26 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|inefficient parameter       |inefficient parameter
                   |passing on x86              |passing on x86 (useless
                   |                            |stack space allocated)


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


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

* [Bug rtl-optimization/17237] inefficient parameter passing on x86
  2004-08-30  5:58 [Bug rtl-optimization/17237] New: inefficient parameter passing on x86 dann at godzilla dot ics dot uci dot edu
                   ` (2 preceding siblings ...)
  2004-10-07  0:26 ` [Bug rtl-optimization/17237] inefficient parameter passing on x86 (useless stack space allocated) giovannibajo at libero dot it
@ 2004-10-07  0:26 ` giovannibajo at libero dot it
  2004-10-07 19:55 ` [Bug rtl-optimization/17237] inefficient parameter passing on x86 (useless stack space allocated) rth at gcc dot gnu dot org
  2004-10-07 19:57 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-10-07  0:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-10-07 00:26 -------
OK, let's keep this bug for the additional subl instruction. Not a regression 
though.

RTH, any idea how the subl instruction appears? Is this a generic problem, or 
x86 specific?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org
           Severity|normal                      |enhancement
             Status|RESOLVED                    |UNCONFIRMED
           Keywords|                            |missed-optimization
      Known to fail|                            |2.95 3.4.3 4.0.0
         Resolution|WORKSFORME                  |


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


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

* [Bug rtl-optimization/17237] inefficient parameter passing on x86 (useless stack space allocated)
  2004-08-30  5:58 [Bug rtl-optimization/17237] New: inefficient parameter passing on x86 dann at godzilla dot ics dot uci dot edu
                   ` (3 preceding siblings ...)
  2004-10-07  0:26 ` [Bug rtl-optimization/17237] inefficient parameter passing on x86 giovannibajo at libero dot it
@ 2004-10-07 19:55 ` rth at gcc dot gnu dot org
  2004-10-07 19:57 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-10-07 19:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-10-07 19:55 -------
This is gcc keeping the stack aligned.  Use -mpreferred-stack-boundary=2 to
eliminate it.

-- 


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


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

* [Bug rtl-optimization/17237] inefficient parameter passing on x86 (useless stack space allocated)
  2004-08-30  5:58 [Bug rtl-optimization/17237] New: inefficient parameter passing on x86 dann at godzilla dot ics dot uci dot edu
                   ` (4 preceding siblings ...)
  2004-10-07 19:55 ` [Bug rtl-optimization/17237] inefficient parameter passing on x86 (useless stack space allocated) rth at gcc dot gnu dot org
@ 2004-10-07 19:57 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-07 19:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-07 19:57 -------
So this is fixed so closing.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2004-10-07 19:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-30  5:58 [Bug rtl-optimization/17237] New: inefficient parameter passing on x86 dann at godzilla dot ics dot uci dot edu
2004-10-06 23:36 ` [Bug rtl-optimization/17237] " giovannibajo at libero dot it
2004-10-07  0:05 ` dann at godzilla dot ics dot uci dot edu
2004-10-07  0:26 ` [Bug rtl-optimization/17237] inefficient parameter passing on x86 (useless stack space allocated) giovannibajo at libero dot it
2004-10-07  0:26 ` [Bug rtl-optimization/17237] inefficient parameter passing on x86 giovannibajo at libero dot it
2004-10-07 19:55 ` [Bug rtl-optimization/17237] inefficient parameter passing on x86 (useless stack space allocated) rth at gcc dot gnu dot org
2004-10-07 19:57 ` pinskia at gcc dot gnu dot org

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