[Bug target/60778] shift not folded into shift on x86-64

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Sep 27 07:59:52 GMT 2021


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Uroš Bizjak from comment #3)
> (In reply to Andrew Pinski from comment #2)
> > Trying 7 -> 8:
> >     7: {r87:DI=r89:DI>>0x3;clobber flags:CC;}
> >       REG_DEAD r89:DI
> >       REG_UNUSED flags:CC
> >     8: r88:DF=[r87:DI*0x8+`mem']
> >       REG_DEAD r87:DI
> > Failed to match this instruction:
> > (set (reg:DF 88 [ mem[_1] ])
> >     (mem:DF (plus:DI (and:DI (reg:DI 89)
> >                 (const_int -8 [0xfffffffffffffff8]))
> >             (symbol_ref:DI ("mem") [flags 0x2]  <var_decl 0x7f6b6efd9c60
> > mem>)) [1 mem[_1]+0 S8 A64]))
> > 
> > We have 2->2 combine now but it looks like we don't try to split inside a
> > mem ...
> 
> This address looks similar to how Alpha implemented unaligned load. It looks
> like combine tries to synthesize AND address.

That is from the (x >> 3) * 8.  Perhaps a combine splitter that will tell
combine that it should split it at the AND?  Though, not sure if the cost will
say that it is beneficial.


More information about the Gcc-bugs mailing list