https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122539
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Andre Simoes Dias Vieira <[email protected]>: https://gcc.gnu.org/g:0ea9ba6ed73d92335d62bb4e19764514faa2db8c commit r15-10528-g0ea9ba6ed73d92335d62bb4e19764514faa2db8c Author: Andre Vieira <[email protected]> Date: Wed Nov 12 10:25:14 2025 +0000 arm: Fix CMSE clearing of union members with no padding [PR122539] This patch fixes the CMSE register clearing to make sure we don't clear registers used by a function call. Before this patch the algorithm would only correctly handle registers with padding bits to clear, any registers that were fully utilised would be wrongfully cleared. gcc/ChangeLog: PR target/122539 * config/arm/arm.cc (comp_not_to_clear_mask_str_un): Update not_to_clear_reg_mask for union members. gcc/testsuite/ChangeLog: * gcc.target/arm/cmse/union-3.x: New test. * gcc.target/arm/cmse/baseline/union-3.c: New test. * gcc.target/arm/cmse/mainline/8m/union-3.c: New test. * gcc.target/arm/cmse/mainline/8_1m/union-3.c: New test. (cherry picked from commit 4aa3af633c26d61ad2a247bb3399cf815dd757e3)
