public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "steven at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/39871] [4.3/4.4/4.5 regression] Code size increase on ARM due to poor register allocation
Date: Wed, 10 Feb 2010 22:50:00 -0000	[thread overview]
Message-ID: <20100210225003.32667.qmail@sourceware.org> (raw)
In-Reply-To: <bug-39871-17592@http.gcc.gnu.org/bugzilla/>



------- Comment #16 from steven at gcc dot gnu dot org  2010-02-10 22:50 -------
In fwprop.c of r118475, we get to propagate_rtx_1 (fwprop.c:334):

          /* Copy propagations are always ok.  Otherwise check the costs.  */
          if (!(REG_P (old) && REG_P (new))
              && !should_replace_address (op0, new_op0, GET_MODE (x)))
            return true;

At this point the simplified address has been found, but fwprop decides not to
substitute the new address:

(gdb) p debug_rtx(op0)
(plus:SI (reg/f:SI 102)
    (const_int 4 [0x4]))
$58 = void
(gdb) p debug_rtx(new_op0)
(plus:SI (reg/f:SI 25 sfp)
    (const_int -8 [0xfffffffffffffff8]))
$59 = void
(gdb) p should_replace_address(op0,new_op0,SImode)
$60 = 0 '\000'

The replacement isn't done because fwprop sees no benefit in doing the
transformation. Stepping through should_replace_address we get:

202       gain = address_cost (old, mode) - address_cost (new, mode);
(gdb) next
208       if (gain == 0)
(gdb) p gain
$64 = 0
(gdb) next
209         gain = rtx_cost (new, SET) - rtx_cost (old, SET);
(gdb) 
211       return (gain > 0);
(gdb) p gain
$65 = 0

Perhaps we should prefer addresses based on the frame pointer over other
addresses?


-- 


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


  parent reply	other threads:[~2010-02-10 22:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 16:16 [Bug rtl-optimization/39871] New: [4.3/4.4/4.5 regression] CSE doesn't work alexvod at google dot com
2009-04-24  9:14 ` [Bug rtl-optimization/39871] " rguenth at gcc dot gnu dot org
2009-05-05 15:41 ` [Bug rtl-optimization/39871] [4.3/4.4/4.5 regression] Code size increase on ARM due to inferior CSE mmitchel at gcc dot gnu dot org
2009-05-06 15:07 ` bonzini at gnu dot org
2009-05-20 14:17 ` ramana at gcc dot gnu dot org
2009-06-14 10:24 ` mikpe at it dot uu dot se
2009-06-14 14:06 ` mikpe at it dot uu dot se
2009-08-04 12:49 ` rguenth at gcc dot gnu dot org
2010-01-02  0:21 ` steven at gcc dot gnu dot org
2010-01-02 10:29 ` bonzini at gnu dot org
2010-01-02 10:31 ` bonzini at gnu dot org
2010-02-08 11:15 ` steven at gcc dot gnu dot org
2010-02-08 11:54 ` rguenth at gcc dot gnu dot org
2010-02-10 12:18 ` jingyu at google dot com
2010-02-10 13:01 ` steven at gcc dot gnu dot org
2010-02-10 13:04 ` steven at gcc dot gnu dot org
2010-02-10 16:28 ` steven at gcc dot gnu dot org
2010-02-10 17:23 ` [Bug rtl-optimization/39871] [4.3/4.4/4.5 regression] Code size increase on ARM due to poor register allocation steven at gcc dot gnu dot org
2010-02-10 17:50 ` steven at gcc dot gnu dot org
2010-02-10 19:25 ` steven at gcc dot gnu dot org
2010-02-10 22:50 ` steven at gcc dot gnu dot org [this message]
2010-02-10 23:11 ` bonzini at gnu dot org
2010-02-10 23:45 ` ramana at gcc dot gnu dot org
2010-02-10 23:47 ` steven at gcc dot gnu dot org
2010-02-10 23:53 ` steven at gcc dot gnu dot org
2010-03-18  8:29 ` steven at gcc dot gnu dot org
2010-03-18  8:31 ` steven at gcc dot gnu dot org
2010-04-06 11:38 ` rguenth at gcc dot gnu dot org
2010-06-04 12:44 ` [Bug rtl-optimization/39871] [4.3/4.4/4.5/4.6 " bernds at gcc dot gnu dot org
2010-06-17 21:52 ` bernds at gcc dot gnu dot org
2010-06-17 21:55 ` bernds at gcc dot gnu dot 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=20100210225003.32667.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).