[Bug middle-end/115913] [12/13/14/15 Regression] ICE with pragma GCC pop_options with diagnostic since r11-1141
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Feb 2 15:49:07 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115913
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Lewis Hyatt <lhyatt@gcc.gnu.org>:
https://gcc.gnu.org/g:c0008df2118233f1afbed76ce308b4dfb6e6fc1a
commit r15-7323-gc0008df2118233f1afbed76ce308b4dfb6e6fc1a
Author: Lewis Hyatt <lhyatt@gmail.com>
Date: Sun Jan 26 18:57:00 2025 -0500
options: Adjust cl_optimization_compare to avoid checking ICE [PR115913]
At the end of a sequence like:
#pragma GCC push_options
...
#pragma GCC pop_options
the handler for pop_options calls cl_optimization_compare() (as generated
by
optc-save-gen.awk) to make sure that all global state has been restored to
the value it had prior to the push_options call. The verification is
performed for almost all entries in the global_options struct. This leads
to
unexpected checking asserts, as discussed in the PR, in case the state of
warnings-related options has been intentionally modified in between
push_options and pop_options via a call to #pragma GCC diagnostic. Address
that by skipping the verification for CL_WARNING-flagged options.
gcc/ChangeLog:
PR middle-end/115913
* optc-save-gen.awk (cl_optimization_compare): Skip options with
CL_WARNING flag.
gcc/testsuite/ChangeLog:
PR middle-end/115913
* c-c++-common/cpp/pr115913.c: New test.
More information about the Gcc-bugs
mailing list