https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93171
--- Comment #1 from Kishan Parmar <kishan at gcc dot gnu.org> ---
Made smaller testcase!
typedef unsigned long long uint64_t;
typedef union {
uint64_t u64;
struct {
uint64_t op : 4;
uint64_t type : 3;
uint64_t tag : 32;
} s;
} TagReq;
void foo(uint64_t *a, int type, int tag) {
TagReq req;
req.u64 = 0;
req.s.tag = tag;
req.s.type = type;
*a = req.u64;
}
Combine fails here, Which is obvious since the masks are not valid!
233 Trying 14, 12 -> 15:
234 14: r138:DI=r150:DI<<0x7&0x7fffffff80
235 REG_DEAD r150:DI
236 12: r136:DI=r149:DI<<0x4&0x70
237 REG_DEAD r149:DI
238 15: r139:DI=r136:DI|r138:DI
239 REG_DEAD r138:DI
240 REG_DEAD r136:DI
241 Failed to match this instruction:
242 (set (reg:DI 139 [ _19 ])
243 (ior:DI (and:DI (ashift:DI (reg:DI 150 [ tag ])
244 (const_int 7 [0x7]))
245 (const_int 549755813760 [0x7fffffff80]))
246 (and:DI (ashift:DI (reg:DI 149 [ type ])
247 (const_int 4 [0x4]))
248 (const_int 112 [0x70]))))