public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/17236] inefficient code for long long multiply on x86
Date: Tue, 18 Dec 2007 13:48:00 -0000	[thread overview]
Message-ID: <20071218134722.13372.qmail@sourceware.org> (raw)
In-Reply-To: <bug-17236-1008@http.gcc.gnu.org/bugzilla/>



------- Comment #11 from ubizjak at gmail dot com  2007-12-18 13:47 -------
Generated code for a similar example is just plain stupid:

--cut here--
int test(long long a, long long b)
{
        return a * b;
}
--cut here--

gcc -O3:

test:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        movl    %esi, 4(%esp)
        movl    16(%ebp), %esi
        movl    %ebx, (%esp)
        movl    8(%ebp), %ebx
        movl    %esi, %eax
        movl    4(%esp), %esi
        mull    %ebx
        movl    (%esp), %ebx
        movl    %ebp, %esp
        popl    %ebp
        ret

gcc-4.0 is a little less creative and creates:

test:
        pushl   %ebp
        movl    %esp, %ebp
        pushl   %edi
        pushl   %esi
        pushl   %ebx
        movl    8(%ebp), %eax
        mull    16(%ebp)
        popl    %ebx
        popl    %esi
        popl    %edi
        leave
        ret


-- 


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


  parent reply	other threads:[~2007-12-18 13:48 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-17236-1008@http.gcc.gnu.org/bugzilla/>
2007-02-02  0:17 ` roger at eyesopen dot com
2007-11-23 20:48 ` steven at gcc dot gnu dot org
2007-12-18  7:43 ` bonzini at gnu dot org
2007-12-18  7:53 ` bonzini at gnu dot org
2007-12-18  8:05 ` bonzini at gnu dot org
2007-12-18  8:10 ` ebotcazou at gcc dot gnu dot org
2007-12-18 13:48 ` ubizjak at gmail dot com [this message]
2007-12-18 16:02 ` bonzini at gnu dot org
2007-12-18 16:39 ` jakub at gcc dot gnu dot org
2007-12-18 16:51 ` bonzini at gnu dot org
2007-12-18 18:20 ` ubizjak at gmail dot com
2007-12-18 18:33 ` ubizjak at gmail dot com
2007-12-19  9:49 ` bonzini at gnu dot org
2007-12-19 12:11 ` ubizjak at gmail dot com
2007-12-19 12:14 ` bonzini at gnu dot org
2007-12-19 12:32 ` bonzini at gnu dot org
2007-12-19 12:43 ` bonzini at gnu dot org
2007-12-19 13:12 ` ubizjak at gmail dot com
2007-12-19 13:36 ` bonzini at gnu dot org
2007-12-19 13:49 ` steven at gcc dot gnu dot org
2007-12-19 13:50 ` bonzini at gnu dot org
2007-12-19 13:54 ` bonzini at gnu dot org
2007-12-20 13:53 ` bonzini at gnu dot org
2007-12-20 14:16 ` bonzini at gnu dot org
2008-03-07  8:27 ` bonzini at gnu dot org
2008-03-07  8:42 ` bonzini at gnu dot org
2008-09-06 16:12 ` ubizjak at gmail dot com
2008-09-06 16:19 ` ubizjak at gmail dot com
2008-09-06 16:20 ` ubizjak at gmail dot com
2004-08-30  5:50 [Bug rtl-optimization/17236] New: " dann at godzilla dot ics dot uci dot edu
2004-10-06 23:27 ` [Bug rtl-optimization/17236] " giovannibajo at libero dot it
2005-03-14 18:24 ` cvs-commit at gcc dot gnu dot org
2005-03-15 10:05 ` giovannibajo at libero dot it
2005-03-15 10:07 ` giovannibajo at libero dot it

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071218134722.13372.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).