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  <ja...@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 via email to