https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97175
Bug ID: 97175
Summary: ice in maybe_warn_for_bound, at builtins.c:3483
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
For this C source code:
int a, b;
int *c;
void d() {
while (a > 0)
;
c = malloc(1);
strncpy(c, b, a);
}
compiled by recent gcc trunk and compiler flag -O2, does this:
during RTL pass: expand
bug642.c:7:3: internal compiler error: tree check: expected tree that contains
‘
decl minimal’ structure, have ‘ssa_name’ in maybe_warn_for_bound, at
builtins.c:
3483
0xfb13c0 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure
_enum, char const*, int, char const*)
../../trunk.git/gcc/tree.c:9902
0x74e77b contains_struct_check(tree_node*, tree_node_structure_enum, char
const*
, int, char const*)
../../trunk.git/gcc/tree.h:3413
0x74e77b maybe_warn_for_bound(int, unsigned int, tree_node*, tree_node*,
tree_no
de**, tree_node*, access_data const*)
../../trunk.git/gcc/builtins.c:3483
0x74d796 check_access(tree_node*, tree_node*, tree_node*, tree_node*,
tree_node*
, access_mode, access_data const*)
The bug first seems to occur sometime between 20200827 and 20200829.