https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111454
Bug ID: 111454
Summary: ice in get_nonzero_bits
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: ---
Given the following partially reduced C code
(safe_div_func_int16_t_s_s)(short si1, short si2) {
return ((si2 == 0) || 0) ? : (si1 / si2);
}
short(safe_rshift_func_int16_t_s_s)();
g_3202 = 0x5FL;
void func_1() __attribute__((,
visibility0, optimize("-O2"), aligned0));
void func_1() {
short __trans_tmp_4;
int __trans_tmp_3;
int l_4 __attribute__(()) = 0;
int l_3120 __attribute__(()) = 0L;
{
for (0;; ++l_3120) {
{
g_3202 = 5;
for (g_3202; (g_3202 > 0); g_3202--) {
(l_4) = ((safe_rshift_func_int16_t_s_s()));
break;
}
}
__trans_tmp_4 = safe_div_func_int16_t_s_s((0 != (4294967292UL)), (l_4));
__trans_tmp_3 = safe_lshift_func_int16_t_s_s((__trans_tmp_4), 15);
}
}
}
when compiled by recent gcc and -O1, does this:
$ /home/dcb38/gcc/results/bin/gcc -w -c -O1 ~/cvise/bug958B.c
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Stack backtrace seems to be:
#0 0x00000000010e502a in get_nonzero_bits (name=name@entry=0x7fffe9fed1b0)
at ../../trunk.year/gcc/tree-ssanames.cc:494
#1 0x0000000000a452dc in tree_nonzero_bits (t=0x7fffe9fed1b0)
at ../../trunk.year/gcc/fold-const.cc:16792
#2 0x0000000001deb61f in gimple_zero_one_valued_p (t=0x7fffe9fed1b0,
valueize=valueize@entry=0x1084e10 <rpo_vn_valueize(tree_node*)>)
at gimple-match-3.cc:19
#3 0x0000000001deb728 in gimple_zero_one_valued_p (t=0x7fffe9fedf30,
valueize=valueize@entry=0x1084e10 <rpo_vn_valueize(tree_node*)>)
at gimple-match-3.cc:70
#4 0x0000000001deb728 in gimple_zero_one_valued_p (t=0x7fffe9fed1b0,
valueize=valueize@entry=0x1084e10 <rpo_vn_valueize(tree_node*)>)
at gimple-match-3.cc:70
The bug first seems to occur sometime between g:f73d2d61a5926f42
and gb975c0dc3be28565, a range of 130 commits.