https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122139
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by David Faust <[email protected]>: https://gcc.gnu.org/g:0d9ebfd78c211daac9d2787c8f2cd66297e8b977 commit r15-11704-g0d9ebfd78c211daac9d2787c8f2cd66297e8b977 Author: David Faust <[email protected]> Date: Wed Oct 15 13:36:38 2025 -0700 bpf: fix memset miscompilation with larger stores [PR122139] The BPF backend expansion of setmem was broken, because it could elect to use stores of HI, SI or DI modes based on the destination alignment when the value was QI, but fail to duplicate the byte value across to those larger sizes. This resulted in not all bytes of the destination actually being set to the desired value. Fix bpf_expand_setmem to ensure the desired byte value is really duplicated as necessary, whether it is constant or a (sub)reg:QI. PR target/122139 gcc/ * config/bpf/bpf.cc (bpf_expand_setmem): Duplicate byte value across to new mode when using larger modes for store. gcc/testsuite/ * gcc.target/bpf/memset-3.c: New. * gcc.target/bpf/memset-4.c: New. (cherry picked from commit 239535e9b0c4313072dda0ee1dcbd8ad8636a326)
