https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89091
Bug ID: 89091
Summary: ICE: Segmentation fault (in tree_class_check)
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
Target Milestone: ---
Target: x86_64-unknown-linux-gnu
gcc-9.0.0-alpha20190127 snapshot (r268327), 9.0, 8.2, 7.4, 6.3, 5.4, 4.9.4,
4.8.5, 4.7.4, 4.6.4 all ICE when compiling the following testcase at any
optimization level:
struct b8 {
unsigned __int128 tv : 65;
};
int
sn (struct b8 *pj, int lp)
{
return lp && pj->tv;
}
% x86_64-unknown-linux-gnu-gcc-9.0.0-alpha20190127 -O1 -c xmcrisq9.c
xmcrisq9.c: In function 'sn':
xmcrisq9.c:8:3: internal compiler error: Segmentation fault
8 | return lp && pj->tv;
| ^~~~~~
0xd7147f crash_signal
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/toplev.c:326
0xa77e95 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/tree.h:3298
0xa77e95 decode_field_reference
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/fold-const.c:4327
0xa843fb fold_truth_andor_1
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/fold-const.c:5903
0xa859e4 fold_truth_andor
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/fold-const.c:8239
0xa69e19 fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/fold-const.c:10523
0xa70539 fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/fold-const.c:12350
0x8487ee c_fully_fold_internal
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/c/c-fold.c:535
0x849087 c_fully_fold(tree_node*, bool, bool*, bool)
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/c/c-fold.c:125
0x7fda7d c_finish_return(unsigned int, tree_node*, tree_node*)
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/c/c-typeck.c:10524
0x83b007 c_parser_statement_after_labels
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/c/c-parser.c:5521
0x83bfea c_parser_compound_statement_nostart
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/c/c-parser.c:5146
0x83c558 c_parser_compound_statement
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/c/c-parser.c:4980
0x83de55 c_parser_declaration_or_fndef
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/c/c-parser.c:2352
0x84520f c_parser_external_declaration
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/c/c-parser.c:1653
0x845c49 c_parser_translation_unit
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/c/c-parser.c:1534
0x845c49 c_parse_file()
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/c/c-parser.c:19840
0x89992b c_common_parse_file()
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190127/work/gcc-9-20190127/gcc/c-family/c-opts.c:1155
(g++ ICEs similarly.)