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

--- Comment #3 from vfdff <zhongyunde at huawei dot com> ---
* test: https://gcc.godbolt.org/z/5s4Wbs466
```
void mset (int *a, int num) {
   for (int i=0; i< num; i++)
     a[i] = 2;
}
```

* the issue is still exist with int type as we use 32-bits register? . see
detail on gcc's assemble:

```
mset:
        cmp     w1, 0
        ble     .L1
        mov     x2, 0
        cntw    x3
        whilelo p0.s, wzr, w1
        mov     z0.s, #2
.L3:
        st1w    z0.s, p0, [x0, x2, lsl 2]
        add     x2, x2, x3   --  overflow a 32-bit value ?
        whilelo p0.s, w2, w1   
        b.any   .L3
.L1:
        ret
```

Reply via email to