[Bug c/94842] [8/9/10 Regression] internal compiler error: in gimplify_label_expr, at gimplify.c:2573
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu May 7 13:27:44 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94842
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:61fb8963c22d91152a9c46a3512307bef3b3d7f7
commit r10-8109-g61fb8963c22d91152a9c46a3512307bef3b3d7f7
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Apr 30 21:48:30 2020 +0200
c: Fix ICE with _Atomic side-effect in nested fn param decls [PR94842]
If there are _Atomic side-effects in the parameter declarations
of non-nested function, when they are parsed, current_function_decl is
NULL, the create_artificial_label created labels during build_atomic* are
then adjusted by store_parm_decls through set_labels_context_r callback.
Unfortunately, if such thing happens in nested function parameter
declarations, while those decls are parsed current_function_decl is the
parent function (and am not sure it is a good idea to temporarily clear it,
some code perhaps should be aware it is in a nested function, or it can
refer to variables from the parent function etc.) and that means
store_param_decls through set_labels_context_r doesn't adjust anything.
As those labels are emitted in the nested function body rather than in the
parent, I think it is ok to override the context in those cases.
2020-04-30 Jakub Jelinek <jakub@redhat.com>
PR c/94842
* c-decl.c (set_labels_context_r): In addition to context-less
LABEL_DECLs adjust also LABEL_DECLs with context equal to
parent function if any.
(store_parm_decls): Adjust comment.
* gcc.dg/pr94842.c: New test.
More information about the Gcc-bugs
mailing list