public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amker at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/64348] [5 Regression] Case scal-to-vec1.c failed on arm-linux-gnueabi with -fPIC
Date: Sat, 20 Dec 2014 09:21:00 -0000	[thread overview]
Message-ID: <bug-64348-4-ifUemOkmQY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64348-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64348

--- Comment #1 from amker at gcc dot gnu.org ---
IRA made below decision:

;; a299(r989,l0) conflicts: a57(r1696,l0) a177(r130,l0) a221(r131,l0)
a63(r1714,l0) a178(r822,l0) a224(r823,l0) a69(r1713,l0) a180(r815,l0)
a227(r816,l0) a75(r1712,l0) a182(r808,l0) a230(r809,l0) a81(r1711,l0)
a184(r801,l0) a233(r802,l0) a87(r1710,l0) a186(r794,l0) a236(r795,l0)
a93(r1709,l0) a188(r787,l0) a239(r788,l0) a100(r1708,l0) a190(r128,l0)
a191(r780,l0) a247(r781,l0) a284(r126,l0) a175(r125,l0) a14(r1706,l0)
a138(r141,l0) a139(r742,l0) a141(r737,l0) a143(r732,l0) a145(r727,l0)
a147(r722,l0) a149(r717,l0) a151(r139,l0) a152(r712,l0) a105(r1695,l0)
a291(r992,l0)
;;     total conflict hard regs: 0 1 12 14
;;     conflict hard regs: 0 1 12 14

Spilling a100r1708 for a299r989
Assigning 2 to a299r989

With ira dump like below:
  430: [sfp:SI-0x30]=r989:TI#0
  432: [r1706:SI+0x4]=r989:TI#4
  434: [r1706:SI+0x8]=r989:TI#8
  436: [r1706:SI+0xc]=r989:TI#12
  441: r0:DI=call [`__aeabi_idivmod'] argc:0
      REG_UNUSED r0:SI
      REG_CALL_DECL `__aeabi_idivmod'
      REG_EH_REGION 0xffffffff80000000
  437: r1007:SI=sign_extend(r989:TI#0)
      REG_DEAD r989:TI

lra needs to split r989 between 436 and 437 with call_save_p holds.  Since r989
is a register in TImode, the save/restore requires more than 2 instructions,
code in split_reg has:
  if (NEXT_INSN (save) != NULL_RTX)
    {
      lra_assert (! call_save_p);
      if (lra_dump_file != NULL)
    {
      fprintf
        (lra_dump_file,
         "      Rejecting split %d->%d resulting in > 2 %s save insns:\n",
         original_regno, REGNO (new_reg), call_save_p ? "call" : "");
      dump_rtl_slim (lra_dump_file, save, NULL, -1, 0);
      fprintf (lra_dump_file,
           "    ))))))))))))))))))))))))))))))))))))))))))))))))\n");
    }
      return false;
    }
  restore = emit_spill_move (false, new_reg, original_reg);
  if (NEXT_INSN (restore) != NULL_RTX)
    {
      lra_assert (! call_save_p);
      if (lra_dump_file != NULL)
    {
      fprintf (lra_dump_file,
           "    Rejecting split %d->%d "
           "resulting in > 2 %s restore insns:\n",
           original_regno, REGNO (new_reg), call_save_p ? "call" : "");
      dump_rtl_slim (lra_dump_file, restore, NULL, -1, 0);
      fprintf (lra_dump_file,
           "    ))))))))))))))))))))))))))))))))))))))))))))))))\n");
    }
      return false;
    }

It assumes that number of save/restore instructions for call_save_p registers
isn't larger than 2, which apparently no true in this case for r989:TI.

This can be fixed by splitting call_save_p register even it results in more
instruction, but I am not sure if it should be fixed before this code.

Also, we don't need to save/resotre all 16 bytes of r989 here, because only 4
bytes of them is live across the call.  Maybe lra can be improved for this
case, but that's another optimization issue.


  parent reply	other threads:[~2014-12-20  9:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18  8:38 [Bug target/64348] New: " amker at gcc dot gnu.org
2014-12-18 10:21 ` [Bug target/64348] [5 Regression] " rguenth at gcc dot gnu.org
2014-12-20  9:21 ` amker at gcc dot gnu.org [this message]
2015-01-09  6:20 ` amker at gcc dot gnu.org
2015-01-13 10:27 ` rguenth at gcc dot gnu.org
2015-01-13 10:51 ` amker 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-64348-4-ifUemOkmQY@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).