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

--- Comment #26 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
I think I find the problem root. We have

********** Local #2: **********
         Choosing alt 0 in insn 1804:  (0) =v  (1) %0  (2) vm  (3) v
{*fma_fmadd_df}
      Creating newreg=4707 from oldreg=1801, assigning class ALL_SSE_REGS to
r4707
      Creating newreg=4708 from oldreg=1801, assigning class ALL_SSE_REGS to
r4708
      Making reload reg 4708 for reg 1801 optional
 1804: r4707:DF={r4707:DF*r4708:DF+r984:DF}
!      REG_DEAD r1801:DF
      REG_DEAD r984:DF
    Inserting insn reload before:
 10917: r4707:DF=r1801:DF
 10919: r4708:DF=r1801:DF
    Inserting insn reload after:
 10918: r238:DF=r4707:DF
.........
         Choosing alt 2 in insn 1814:  (0) v  (1) v  (2) vm  (3) 0
{*fma_fmadd_df}
      Creating newreg=4709 from oldreg=1801, assigning class ALL_SSE_REGS to
r4709
      Making reload reg 4709 for reg 1801 optional
 1814: r244:DF={r1795:DF*r4709:DF+r1803:DF}
      REG_DEAD r1801:DF
      REG_DEAD r1803:DF
    Inserting insn reload before:
 10920: r4709:DF=r1801:DF

********** Inheritance #2: **********
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    Use smallest class of ALL_SSE_REGS and SSE_REGS
      Creating newreg=4778 from oldreg=1801, assigning class ALL_SSE_REGS to
inheritance r4778
    Original reg change 1801->4778 (bb177):
 10920: r4709:DF=r4778:DF
    Add inheritance<-original before:
 10995: r4778:DF=r1801:DF

    Inheritance reuse change 1801->4778 (bb177):
 10019: r3911:DF=r4778:DF
      REG_DEAD r4778:DF
          >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    Use smallest class of ALL_SSE_REGS and SSE_REGS
      Creating newreg=4779 from oldreg=1801, assigning class ALL_SSE_REGS to
inheritance r4779
    Original reg change 1801->4779 (bb177):
! 10919: r4708:DF=r4779:DF
    Add inheritance<-original before:
 10996: r4779:DF=r1801:DF

    Inheritance reuse change 1801->4779 (bb177):
 10995: r4778:DF=r4779:DF
          >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

********** Assignment #2: **********
         Assigning to 4779 (cl=ALL_SSE_REGS, orig=1801, freq=18, tfirst=4707,
tfreq=36)...
         Assigning to 4778 (cl=ALL_SSE_REGS, orig=1801, freq=18, tfirst=4707,
tfreq=36)...
         Assigning to 4780 (cl=ALL_SSE_REGS, orig=1801, freq=18, tfirst=4707,
tfreq=36)...
           Assign 26 to inheritance r4780 (freq=18)
  Reassigning non-reload pseudos
           Assign 4 to r237 (freq=26)
           Assign 26 to inheritance r4778 (freq=18)
!        Hard reg 26 is preferable by r4779 with profit 24
           Assign 26 to inheritance r4779 (freq=18)

We assigned 26 for conflicting 4779 and 4707 because they have the same value
1802 (from r1801).

4707 got the same value as 1801 because LRA sees wrong (REG_DEAD r1801:DF) in
insn 1804.  In most cases LRA uses live-ranges but in constraint sub-pass it
can use reg notes too.
Live ranges and reg notes should be synchronized but in this case we did not
update notes after
first inheritance sub-pass although there were some changes there too.

I working on a patch.  If the tests are ok, I commit the patch today.

Reply via email to