[Bug c/94842] [8/9 Regression] internal compiler error: in gimplify_label_expr, at gimplify.c:2573

2020-09-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94842

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #12 from Jakub Jelinek  ---
Fixed for 8.5 in r8-10500-gb79f3e1e67ca0c5e14b677e3fc847a3c79881b5f and for
9.4+ by the above commit.

[Bug c/94842] [8/9 Regression] internal compiler error: in gimplify_label_expr, at gimplify.c:2573

2020-09-16 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94842

--- Comment #11 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:b66139a3ba159473432edabb983c62219a28590d

commit r9-8894-gb66139a3ba159473432edabb983c62219a28590d
Author: Jakub Jelinek 
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  

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.

(cherry picked from commit 61fb8963c22d91152a9c46a3512307bef3b3d7f7)

[Bug c/94842] [8/9 Regression] internal compiler error: in gimplify_label_expr, at gimplify.c:2573

2020-05-07 Thread paul.hua.gm at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94842

Paul Hua  changed:

   What|Removed |Added

 CC||paul.hua.gm at gmail dot com

--- Comment #10 from Paul Hua  ---
ICEed on mips64el.

gcc_git_trunk/gcc/testsuite/gcc.dg/pr94842.c:8:1: internal compiler error:
Segmentation fault^M
0x1209b7233 crash_signal^M
../../../gcc_git_trunk/gcc/toplev.c:328^M
0x120a9eb85 tree_check(tree_node*, char const*, int, char const*, tree_code)^M
../../../gcc_git_trunk/gcc/tree.h:3293^M
0x120a9eb85 convert_nonlocal_reference_op^M
../../../gcc_git_trunk/gcc/tree-nested.c:1064^M
0x120d7f81f walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))^M
../../../gcc_git_trunk/gcc/tree.c:12001^M
0x1205e5adb walk_gimple_op(gimple*, tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)^M
../../../gcc_git_trunk/gcc/gimple-walk.c:268^M
0x1205e5da7 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)^M
../../../gcc_git_trunk/gcc/gimple-walk.c:596^M
0x1205e610b walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)^M
../../../gcc_git_trunk/gcc/gimple-walk.c:51^M
0x1205e5f17 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)^M
../../../gcc_git_trunk/gcc/gimple-walk.c:605^M
0x1205e610b walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)^M
../../../gcc_git_trunk/gcc/gimple-walk.c:51^M
0x120a972ff walk_body^M
../../../gcc_git_trunk/gcc/tree-nested.c:713^M
0x120a972ff walk_function^M
../../../gcc_git_trunk/gcc/tree-nested.c:724^M
0x120a972ff walk_all_functions^M
../../../gcc_git_trunk/gcc/tree-nested.c:789^M
0x120aa206b lower_nested_functions(tree_node*)^M
../../../gcc_git_trunk/gcc/tree-nested.c:3551^M
0x1203c55db cgraph_node::analyze()^M
../../../gcc_git_trunk/gcc/cgraphunit.c:676^M
0x1203c995f analyze_functions^M
../../../gcc_git_trunk/gcc/cgraphunit.c:1227^M
0x1203caaf3 symbol_table::finalize_compilation_unit()^M
../../../gcc_git_trunk/gcc/cgraphunit.c:2974^M
Please submit a full bug report,^M
with preprocessed source if appropriate.^M
Please include the complete backtrace with any bug report.^M
See  for instructions.^M
compiler exited with status 1

[Bug c/94842] [8/9 Regression] internal compiler error: in gimplify_label_expr, at gimplify.c:2573

2020-05-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94842

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[8/9/10 Regression] |[8/9 Regression] internal
   |internal compiler error: in |compiler error: in
   |gimplify_label_expr, at |gimplify_label_expr, at
   |gimplify.c:2573 |gimplify.c:2573

--- Comment #9 from Jakub Jelinek  ---
Fixed for 10.2+ too.