https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128366
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andrew Stubbs <[email protected]>: https://gcc.gnu.org/g:adc647aa9e6aaea6799032f76524543b5336af80 commit r17-5880-gadc647aa9e6aaea6799032f76524543b5336af80 Author: Andrew Stubbs <[email protected]> Date: Mon Nov 2 15:59:03 2026 +0000 amdgcn: Fix stack size calculation overflow [PR128366] The stack sizes and/or offsets were all written assuming they wouldn't exceed UINT_MAX, which is not safe. This patch fixes the libgomp plugin that creates the stack space, the kernel prologue that initializes the stack pointers in each thread, and the builtin that Newlib uses to locate the reent structs. gcc/ChangeLog: PR target/128366 * config/gcn/gcn.cc (gcn_expand_prologue): Use 64-bit to calculate wave_offset and fp_hi. (gcn_expand_builtin_1): Use 64-bit to calculate stack_limit_offset_di. libgomp/ChangeLog: PR target/128366 * config/gcn/team.c (gomp_gcn_enter_kernel): Use size_t to find the start of the team_arena. * plugin/plugin-gcn.c (configure_ephemeral_memories): Use size_t for actual_arena_total_size.
