public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/50107] [IRA, i386] allocates regiters in very non-optimal way
Date: Thu, 18 Aug 2011 14:55:00 -0000	[thread overview]
Message-ID: <bug-50107-4-iMFA2iv6wA@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50107-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> 2011-08-18 14:44:03 UTC ---
Another problem is

[hjl@gnu-6 pr50107]$ cat udi.i 
extern unsigned long long k2;

unsigned long long test_mul_64 (unsigned long a, unsigned long b)
{
  k2 = (unsigned long long) a * b;
  k2+=3;
  return k2;
}
[hjl@gnu-6 pr50107]$ make udi.s PIC=-m32
/export/build/gnu/gcc-hsw/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-hsw/build-x86_64-linux/gcc/ -S -o udi.s -O2 -mbmi2 -m32
udi.i
[hjl@gnu-6 pr50107]$ cat udi.s
    .file    "udi.i"
    .text
    .p2align 4,,15
    .globl    test_mul_64
    .type    test_mul_64, @function
test_mul_64:
.LFB0:
    .cfi_startproc
    pushl    %ebx
    .cfi_def_cfa_offset 8
    .cfi_offset 3, -8
    movl    8(%esp), %edx
    mulx    12(%esp), %ecx, %ebx
    movl    %ecx, %eax
    movl    %ebx, %edx
    addl    $3, %eax
    adcl    $0, %edx
    movl    %eax, k2
    movl    %edx, k2+4
    popl    %ebx
    .cfi_restore 3
    .cfi_def_cfa_offset 4
    ret
    .cfi_endproc
.LFE0:
    .size    test_mul_64, .-test_mul_64
    .ident    "GCC: (GNU) 4.7.0 20110817 (experimental)"
    .section    .note.GNU-stack,"",@progbits
[hjl@gnu-6 pr50107]$ 

EDX is the input of MULX and dead after MULX.  IRA should allocate
EAD/EDX for the output of mulx.


  parent reply	other threads:[~2011-08-18 14:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-17 13:42 [Bug rtl-optimization/50107] New: " kirill.yukhin at intel dot com
2011-08-17 13:53 ` [Bug rtl-optimization/50107] " kirill.yukhin at intel dot com
2011-08-17 17:19 ` vmakarov at redhat dot com
2011-08-17 18:58 ` hjl.tools at gmail dot com
2011-08-17 19:18 ` hjl.tools at gmail dot com
2011-08-17 19:32 ` hjl.tools at gmail dot com
2011-08-17 22:29 ` vmakarov at redhat dot com
2011-08-18 14:55 ` hjl.tools at gmail dot com [this message]
2011-08-18 15:03 ` vmakarov at gcc dot gnu.org
2011-08-18 15:31 ` hjl.tools at gmail dot com
2011-08-18 18:29 ` vmakarov at redhat dot com
2011-08-18 19:02 ` hjl.tools at gmail dot com
2011-08-19  6:05 ` [Bug rtl-optimization/50107] [IRA, i386] allocates registers " hjl.tools at gmail dot com
2011-08-19 16:14 ` hjl.tools at gmail dot com
2011-08-19 16:24 ` vmakarov at redhat dot com
2021-12-26 22:18 ` pinskia at gcc dot gnu.org

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=bug-50107-4-iMFA2iv6wA@http.gcc.gnu.org/bugzilla/ \
    --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).