https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93998
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- But SAVE_EXPR does the same thing, so if we need to fix that, we should fix SAVE_EXPR too. If we didn't do: /* If builtin_valid_in_constant_expr_p is true, potential_constant_expression_1 has not recursed into the arguments of the builtin, verify it here. */ if (!builtin_valid_in_constant_expr_p (fun) || potential_constant_expression (arg)) { bool dummy1 = false, dummy2 = false; arg = cxx_eval_constant_expression (&new_ctx, arg, false, &dummy1, &dummy2); } during the builtin handling where we ignore the non_constant_p, we wouldn't have this problem, so one way out of this would be to in this case record save_exprs and if dummy1, reset them. And yet another option is don't push to global->values or push the cleanups if *non_constant_p.