public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "uweigand at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/64115] [4.9/5 Regression] ICE: : in rs6000_delegitimize_address, at config/rs6000/rs6000.c:7051
Date: Mon, 01 Dec 2014 16:26:00 -0000	[thread overview]
Message-ID: <bug-64115-4-0IdIgsaEWt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64115-4@http.gcc.gnu.org/bugzilla/>

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

Ulrich Weigand <uweigand at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dje.gcc at gmail dot com

--- Comment #3 from Ulrich Weigand <uweigand at gcc dot gnu.org> ---
The ICE is triggered by checking code in rs6000_delegitimize_address:

  if (GET_CODE (y) == UNSPEC
      && XINT (y, 1) == UNSPEC_TOCREL)
    {
#ifdef ENABLE_CHECKING
      if (REG_P (XVECEXP (y, 0, 1))
          && REGNO (XVECEXP (y, 0, 1)) == TOC_REGISTER)
        {
          /* All good.  */
        }
      else if (GET_CODE (XVECEXP (y, 0, 1)) == DEBUG_EXPR)
        {
          /* Weirdness alert.  df_note_compute can replace r2 with a
             debug_expr when this unspec is in a debug_insn.
             Seen in gcc.dg/pr51957-1.c  */
        }
      else
        {
          debug_rtx (orig_x);
          abort ();
        }
#endif

which attempts to ensure that the second argument of UNSPEC_TOCREL is the TOC
register.   However, this check seems fragile; in debug code, we can get RTX
simplifications that replace the TOC register by some equivalent expression.

The code already recognizes one such case; this bug shows another case, where
the TOC register is replaced by a MEM RTX for the TOC save slot holding the TOC
value.  [ This case is probably made more likely by the change in my ELFv2 ABI
preparation patch, which has the effect of making TOC moves into the save slot
more explicit at the RTL level, allowing var-tracking code to detect that
equivalence. ]

One could try to make this check in rs6000_delegitimize_address more generic by
allowing some (or all) MEM RTXes.  However, I'm wonding what exactly that check
is supposed to achieve in the first place; for the purposes of this routine,
the second argument of UNSPEC_TOCREL is really irrelevant.

David, would you be OK with simply removing the check (everything enclosed with
ENABLE_CHECKING in the above code)?


  parent reply	other threads:[~2014-12-01 16:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-29  9:56 [Bug target/64115] New: [5 " trippels at gcc dot gnu.org
2014-12-01 10:02 ` [Bug target/64115] [4.9/5 " rguenth at gcc dot gnu.org
2014-12-01 14:45 ` uweigand at gcc dot gnu.org
2014-12-01 16:26 ` uweigand at gcc dot gnu.org [this message]
2014-12-01 20:19 ` dje at gcc dot gnu.org
2014-12-02  1:40 ` amodra at gmail dot com
2014-12-02 14:28 ` uweigand at gcc dot gnu.org
2014-12-02 14:31 ` uweigand at gcc dot gnu.org
2014-12-02 14:33 ` uweigand at gcc dot gnu.org
2014-12-02 14:34 ` uweigand 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-64115-4-0IdIgsaEWt@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).