https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124597
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:968559eb46938ae99f32b673f43df9ab39204535 commit r16-8247-g968559eb46938ae99f32b673f43df9ab39204535 Author: Andrew Pinski <[email protected]> Date: Sat Mar 21 13:16:17 2026 -0700 gimple-fold: Fix folding of va_end with maybe throw builtin [PR124597] The problem here is when we are replacing the va_end with a GIMPLE_NOP, gsi_replace is being called with true for updating the eh information. This was a mistake; for most case this worked but with x86 backend creating a function decl without nothrow on the VA_END, this caused problems of not removing eh edge after removing the call. (The x86 backend change is submitted in a different patch). Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/124597 gcc/ChangeLog: * gimple-fold.cc (gimple_fold_builtin_stdarg): Correct the eh_update argument to gsi_replace for the VA_END case. Signed-off-by: Andrew Pinski <[email protected]>
