public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "law at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/59747] [4.9 Regression] wrong code at -Os and above on x86_64-linux-gnu in 64-bit mode
Date: Fri, 10 Jan 2014 17:14:00 -0000	[thread overview]
Message-ID: <bug-59747-4-cIPaX2DnS2@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59747-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from Jeffrey A. Law <law at redhat dot com> ---
In response to your question in c#6, if you use the most obvious form:

ORIG:
(set (reg1) (expression))
(set (reg2) (any_extend (reg1))
TRANSFORMED:
(set (reg1) (any_extend (expression)))
(set (reg2) (reg1))

Then the copy isn't typically propagated away and we don't actually improve the
code. If we look at the original testcase, the obvious form would look
something like this:

(insn 9 5 24 2 (set (reg:DI 0 ax)
        (sign_extend:DI (mem:HI (plus:DI (mult:DI (reg/v:DI 1 dx [orig:91 rdx ]
[91])
                        (const_int 2 [0x2]))
                    (symbol_ref:DI ("code")  <var_decl 0x7f48935f01c8 code>))
[2 code S2 A16]))) l.c:13 144 {extendhidi2}
     (nil))
(insn 24 9 12 2 (set (reg/v:DI 1 dx [orig:84 rdx ] [84])
        (reg:DI 0 ax)) l.c:13 -1
     (nil))
(note 12 24 13 2 NOTE_INSN_DELETED)
(insn 13 12 14 2 (set (reg:DI 0 ax [orig:95 D.1797 ] [95])
        (zero_extend:DI (reg:QI 0 ax [orig:83 D.1796 ] [83]))) l.c:16 133
{zero_extendqidi2}
     (nil))
(insn 14 13 15 2 (parallel [
            (set (reg:DI 1 dx [orig:96 rdx ] [96])
                (ashiftrt:DI (reg/v:DI 1 dx [orig:84 rdx ] [84])
                    (const_int 8 [0x8])))
            (clobber (reg:CC 17 flags))
        ]) l.c:15 563 {*ashrdi3_1}
     (nil))

To get any improvement we must be able to propagate insn24 away and that's
nontrivial to do in that form.


  parent reply	other threads:[~2014-01-10 17:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-10  6:19 [Bug tree-optimization/59747] New: " su at cs dot ucdavis.edu
2014-01-10  8:48 ` [Bug tree-optimization/59747] [4.9 Regression] " mpolacek at gcc dot gnu.org
2014-01-10 10:05 ` mpolacek at gcc dot gnu.org
2014-01-10 10:17 ` mpolacek at gcc dot gnu.org
2014-01-10 10:58 ` jakub at gcc dot gnu.org
2014-01-10 11:05 ` rguenth at gcc dot gnu.org
2014-01-10 11:08 ` jakub at gcc dot gnu.org
2014-01-10 13:14 ` jakub at gcc dot gnu.org
2014-01-10 16:25 ` law at redhat dot com
2014-01-10 17:14 ` law at redhat dot com [this message]
2014-01-10 17:56 ` law at redhat dot com
2014-01-15 13:11 ` trippels at gcc dot gnu.org
2014-01-15 18:14 ` law at gcc dot gnu.org
2014-01-15 18:14 ` law at redhat dot com
2014-01-16 20:11 ` dominiq at lps dot ens.fr
2014-01-16 20:12 ` dominiq at lps dot ens.fr
2014-01-16 20:12 ` dominiq at lps dot ens.fr
2014-01-16 20:20 ` jakub at gcc dot gnu.org
2014-01-16 21:05 ` dominiq at lps dot ens.fr

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-59747-4-cIPaX2DnS2@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).