https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119210
Bug ID: 119210
Summary: [SME] 'smstart za' seems not to dominate the block
that uses za register
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: xiezhiheng at huawei dot com
Target Milestone: ---
For this test case,
https://godbolt.org/z/ceW9vPxz8
.L12:
ldr d1, [x21, x19, lsl 3]
mov w1, w19
ldr d0, [x20, x19, lsl 3]
mov x0, x23
add x19, x19, 1
bl printf
cmp x19, 64
bne .L12
mov x1, x21
add x3, x29, 128
mrs x16, tpidr2_el0
cbnz x16, .L22 <== it will branch to .L22, and miss 'smstart za'
mov x0, x3
smstart za
bl __arm_tpidr2_restore
.L22:
adrp x23, .LC1
add x23, x23, :lo12:.LC1
msr tpidr2_el0, xzr
mov x19, 0
mov x0, x20
smstart sm
bl example(double*, double*)
smstop sm
mov x0, x22
smstart sm
bl example0(double*)
smstop sm
smstop za
And in my test machine, it will cause an 'Illegal instruction' runtime error.