public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [committed] cselib: Fix endless cselib loop on (plus:P (reg) (const_int 0))
Date: Mon, 06 Apr 2020 16:57:46 -0600	[thread overview]
Message-ID: <ec6c95cb6e73d355c369048fed2d65e6ab29e924.camel@redhat.com> (raw)
In-Reply-To: <20200406223313.GV2212@tucnak>

On Tue, 2020-04-07 at 00:33 +0200, Jakub Jelinek wrote:
> Hi!
> 
> getopt.c hangs the compiler on h8300-elf with -O2 -g, because the
> IL contains addition of constant 0, the first PLUS operand is determined
> to have the SP_DERIVED_VALUE_P and the new code in cselib recurses
> indefinitely on seeing SP_DERIVED_VALUE_P with locs of
> (plus:P SP_DERIVED_VALUE_P (const_int 0)).
> 
> Fixed by making sure cselib_subst_to_values canonicalizes it, hashing
> already hashes it the same too.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, tested on the
> getopt.i testcase using cross to h8300-elf, approved off-list by Jeff,
> committed to trunk.
> 
> 2020-04-06  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* cselib.c (cselib_subst_to_values): For SP_DERIVED_VALUE_P
> 	+ const0_rtx return the SP_DERIVED_VALUE_P.
Thanks.  And just FTR, the scenario where this happens could (in theory) happen
on other ports, particularly those still using reload.

jeff
> 


  reply	other threads:[~2020-04-06 22:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 22:33 Jakub Jelinek
2020-04-06 22:57 ` Jeff Law [this message]
2020-04-07 22:35 ` Joseph Myers
2020-04-07 22:42   ` Jeff Law

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=ec6c95cb6e73d355c369048fed2d65e6ab29e924.camel@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /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).