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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-08-06

--- Comment #1 from Jeffrey A. Law <law at gcc dot gnu.org> ---
A lot of similarities to the most recent bug on the m68k.

We had this prior to ext-dce (from a somewhat reduced testcase, so insn #s
won't match):

(insn 878 877 881 19 (set (reg:DI 35 [ diff$__r ])
        (zero_extend:DI (reg:SI 49 [ _32 ])))
"/notnfs/josmyers/glibc-manual/build/compilers/m68k-linux-gnu-coldfire/gcc/m68k-glibc-linux-gnu/libstdc++-v3/include/bits/chrono.h":574:10
85 {*zero_extendsidi2}
     (expr_list:REG_DEAD (reg:SI 49 [ _32 ])
        (nil)))

We know the upper bits aren't needed, so we turn the zero_extend into a subreg:

(insn 878 877 881 19 (set (reg:DI 35 [ diff$__r ])
        (subreg:DI (reg:SI 49 [ _32 ]) 0))
"/notnfs/josmyers/glibc-manual/build/compilers/m68k-linux-gnu-coldfire/gcc/m68k-glibc-linux-gnu/libstdc++-v3/include/bits/chrono.h":574:10
76 {*m68k.md:1608}
     (expr_list:REG_DEAD (reg:SI 49 [ _32 ])
        (nil)))  


So far, so good.  We assign (reg:SI 49) to d0 resulting in this in the middle
of reload:

(insn 878 877 1042 19 (set (reg:DI 0 %d0 [orig:35 diff$__r ] [35])
        (subreg:DI (reg:SI 0 %d0) 0))
"/notnfs/josmyers/glibc-manual/build/compilers/m68k-linux-gnu-coldfire/gcc/m68k-glibc-linux-gnu/libstdc++-v3/include/bits/chrono.h":574:10
76 {*m68k.md:1608}
     (expr_list:REG_DEAD (reg:SI 0 %d0 [orig:49 _32 ] [49])
        (nil)))


We eventually try to simplify the subreg resulting in:

(insn 878 877 1042 19 (set (reg:DI 0 %d0 [orig:35 diff$__r ] [35])
        (reg:DI -1 [+-4 ]))
"/notnfs/josmyers/glibc-manual/build/compilers/m68k-linux-gnu-coldfire/gcc/m68k-glibc-linux-gnu/libstdc++-v3/include/bits/chrono.h":574:10
76 {*m68k.md:1608}
     (nil))



Which is clearly very bad.

Reply via email to