https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118510
Uroš Bizjak <ubizjak at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2025-01-16
Target Milestone|--- |15.0
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
CC| |hongyuw at gcc dot gnu.org
--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
The compiler is trying to split:
(insn 15 14 16 2 (parallel [
(set (mem/c:SI (plus:DI (reg/f:DI 19 frame)
(const_int -28 [0xffffffffffffffe4])) [1 num.low+0 S4
A32])
(ior:SI (lshiftrt:SI (reg:SI 120)
(subreg:QI (reg:SI 98 [ num_rshift_n.0_1 ]) 0))
(ashift:SI (subreg:SI (reg:DI 122 [ num ]) 0)
(minus:QI (const_int 32 [0x20])
(subreg:QI (reg:SI 98 [ num_rshift_n.0_1 ]) 0)))))
(clobber (reg:CC 17 flags))
]) "pr118510.c":9:37 1165 {*x86_shrd_ndd_2}
(nil))
and manages to create one strange RTX:
(insn 39 38 16 2 (parallel [
(set (reg:SI 124)
(ior:SI (lshiftrt:SI (reg:SI 120)
(and:QI (subreg:QI (reg:SI 98 [ num_rshift_n.0_1 ]) 0)
(const_int 31 [0x1f])))
(subreg:SI (ashift:DI (zero_extend:DI (subreg:SI (reg:DI
122 [ num ]) 0))
(minus:QI (const_int 32 [0x20])
(and:QI (subreg:QI (reg:SI 98 [
num_rshift_n.0_1 ]) 0)
(const_int 31 [0x1f])))) 0)))
(clobber (reg:CC 17 flags))
(set (mem/c:SI (plus:DI (reg/f:DI 19 frame)
(const_int -28 [0xffffffffffffffe4])) [1 num.low+0 S4
A32])
(reg:SI 124))
]) "pr118510.c":9:37 -1
(nil))
The problem is in the split RTX of:
(define_insn_and_split "*x86_shrd_ndd_2"
[(set (match_operand:SI 0 "nonimmediate_operand")
(ior:SI (lshiftrt:SI (match_operand:SI 1 "nonimmediate_operand")
(match_operand:QI 3 "nonmemory_operand"))
(ashift:SI (match_operand:SI 2 "register_operand")
(minus:QI (const_int 32) (match_dup 3)))))
(clobber (reg:CC FLAGS_REG))]
"TARGET_APX_NDD
CC author.