https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112795
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 56754 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56754&action=edit gcc14-pr112795.patch Untested full fix. If we backport at all, I think we could just change the maybe_const_value to fold_non_dependent_expr.