public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vmakarov at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/57046] [4.8/4.9 Regression] wrong code generated by gcc 4.8.0 on i686
Date: Tue, 23 Apr 2013 15:34:00 -0000	[thread overview]
Message-ID: <bug-57046-4-SHCgxdOC0L@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57046-4@http.gcc.gnu.org/bugzilla/>


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

Vladimir Makarov <vmakarov at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vmakarov at redhat dot com

--- Comment #5 from Vladimir Makarov <vmakarov at redhat dot com> 2013-04-23 15:34:40 UTC ---
(In reply to comment #4)
> We have after the get_value call:
> (insn 73 30 32 6 (set (reg:SI 76 [ D.1441 ])
>         (reg:SI 0 ax)) pr57046.c:42 85 {*movsi_internal}
>      (expr_list:REG_DEAD (reg:SI 0 ax)
>         (nil)))
> (insn 32 73 33 6 (parallel [
>             (set (reg:SI 73 [ D.1443 ])
>                 (ashift:SI (subreg:SI (reg:DI 60 [ D.1441 ]) 0)
>                     (const_int 2 [0x2])))
>             (clobber (reg:CC 17 flags))
>         ]) 502 {*ashlsi3_1}
>      (expr_list:REG_DEAD (reg:DI 60 [ D.1441 ])
>         (expr_list:REG_UNUSED (reg:CC 17 flags)
>             (nil))))
> 
> and IRA decides to put pseudo 76 into %ebx and pseudo 60 into %ecx.  Either it
> is an IRA bug, or IRA takes into account that we only really need the low
> 32-bits of pseudo 60 at that point.  In any case, reload loads SImode %ecx from
> the stack and uses it in the shift, while LRA loads full DImode %ecx (i.e. %ecx
> and %ebx) from the stack, then uses just the low bits from that (i.e. %ecx) in
> the shift.  So the LRA generated code clobbers the value in %ebx, and get_value
> call is even later on DCEd because of it.

It seems like a discrepancy in IRA which allocates in terms of subregisters and
LRA splitting (including call save/restore as in this case) in terms of
pseudos.  I guess fixing this might take about week.


  parent reply	other threads:[~2013-04-23 15:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 10:42 [Bug c/57046] New: " mattiase at acm dot org
2013-04-23 11:31 ` [Bug c/57046] " mikpe at it dot uu.se
2013-04-23 12:04 ` [Bug c/57046] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2013-04-23 12:10 ` [Bug rtl-optimization/57046] " jakub at gcc dot gnu.org
2013-04-23 12:26 ` jakub at gcc dot gnu.org
2013-04-23 15:34 ` vmakarov at redhat dot com [this message]
2013-04-26 18:03 ` [Bug rtl-optimization/57046] [4.8 " jakub at gcc dot gnu.org
2013-05-02 19:29 ` jakub at gcc dot gnu.org
2013-05-21  1:53 ` eraman at google dot com

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-57046-4-SHCgxdOC0L@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).