public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "terry.guo at arm dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/57329] ICE with -O2 and -mthumb
Date: Mon, 03 Jun 2013 09:33:00 -0000	[thread overview]
Message-ID: <bug-57329-4-F3vPYx5qPg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57329-4@http.gcc.gnu.org/bugzilla/>

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

Terry Guo <terry.guo at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |terry.guo at arm dot com

--- Comment #2 from Terry Guo <terry.guo at arm dot com> ---
The case has operations on vector for Thumb-1 targets. Thus subreg is generated
for example:

(insn 65 64 66 2 (set (subreg:SI (reg:TI 137 [ D.4126 ]) 4)
        (reg:SI 211)) 187 {*thumb1_movsi_insn}
     (nil))

The subreg:SI is supposed to be turned into normal reg:SI in subreg1 pass.
However current 4.8 branch incorrectly calculates the rtx cost of such
transformation.

Speed costs
===========
SI move: from zero cost 4, from reg cost 4
DI move: original cost 4, split cost 4 * 2
TI move: original cost 4, split cost 4 * 4
EI move: original cost 4, split cost 4 * 6

The subreg will be kept until IRA stage and causes ICE there.

With Bin's patch at http://gcc.gnu.org/ml/gcc-cvs/2013-03/msg00784.html, we
will get correct rtx cost:

Speed costs
===========
SI move: from zero cost 4, from reg cost 4
DI move: original cost 8, split cost 4 * 2
TI move: original cost 16, split cost 4 * 4
EI move: original cost 24, split cost 4 * 6

Then the split happens, we will get:

(insn 65 64 66 2 (set (reg:SI 393 [ D.4126+4 ])
        (reg:SI 211)) 187 {*thumb1_movsi_insn}
     (nil))

and then everything works well.

I believe this is the cause of the issue and am doing back port to 4.8 branch.


  parent reply	other threads:[~2013-06-03  9:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-19  9:30 [Bug c/57329] New: " Martin.Jansa at gmail dot com
2013-05-19  9:30 ` [Bug c/57329] " Martin.Jansa at gmail dot com
2013-06-03  9:33 ` terry.guo at arm dot com [this message]
2013-06-12 16:23 ` [Bug target/57329] " Martin.Jansa at gmail dot com
2013-07-10 22:32 ` ramana 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-57329-4-F3vPYx5qPg@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).