[Bug debug/67355] [5 Regression] ICE compiling LTP testcase, endless cselib recursion from var-tracking
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Aug 26 06:45:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67355
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |i?86-*-*
Target Milestone|--- |5.3
Summary|[5 Regression] ICE |[5 Regression] ICE
|compiling LTP testcase |compiling LTP testcase,
| |endless cselib recursion
| |from var-tracking
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Delta-reduced (w/ includes):
#include <stdio.h>
double pi;
FILE *temp;
static int checkbuf(char *, int, int);
int main(int argc, char *argv[])
{
register int i, j;
char buf[100];
for (i = 0; i < 30; i++)
for (j = 0; j < 30; j++)
{
sprintf(buf, "%*.*f", i, j, pi);
if (checkbuf(buf, i, j)) {
}
}
}
static int checkbuf(char *str, int n1, int n2)
{
register int bd;
/* before decimal point */ register int ad;
/* after decimal point */ register int tw;
/* total width */ register int dp;
/* decimal point */ char *buf;
bd = ad = dp = 0;
while (*str && *str != '.') {
bd++;
str++;
}
if (*str == '.') {
dp++;
str++;
if (*str) {
while (*str) {
ad++;
str++;
}
}
}
tw = bd + dp + ad;
if (tw < n1) {
fprintf(temp, "\tWidth too small.\n");
return (-1);
}
if (ad != n2) {
fprintf(temp, "\tn1 = %d, n2 = %d, buf= '%s'\n", n1, n2, buf);
}
return (0);
}
Program received signal SIGSEGV, Segmentation fault.
0x00000000008a1732 in rtx_equal_for_cselib_1 (x=0x7ffff687c810,
y=0x7ffff687c7f8, memmode=VOIDmode)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:1022
1022 && targetm.commutative_p (x, UNKNOWN)
Missing separate debuginfos, use: zypper install
libgmp10-debuginfo-6.0.0-71.1.x86_64 libisl13-debuginfo-0.14-25.2.x86_64
libmpc3-debuginfo-1.0.2-38.2.x86_64 libmpfr4-debuginfo-3.1.2-3.1.2.x86_64
(gdb) bt
#0 0x00000000008a1732 in rtx_equal_for_cselib_1 (x=0x7ffff687c810,
y=0x7ffff687c7f8, memmode=VOIDmode)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:1022
#1 0x00000000008a12bf in rtx_equal_for_cselib_1 (x=0x7ffff687c810,
y=0x235e920, memmode=VOIDmode)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:924
#2 0x00000000008a17dd in rtx_equal_for_cselib_1 (x=0x7ffff687c7f8,
y=0x7ffff687c810, memmode=VOIDmode)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:1026
#3 0x00000000008a1206 in rtx_equal_for_cselib_1 (x=0x235e920,
y=0x7ffff687c810, memmode=VOIDmode)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:907
... (endless recursion)
entered via
#59 0x00000000008a1206 in rtx_equal_for_cselib_1 (x=0x235e938,
y=0x7ffff687c978, memmode=VOIDmode)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:907
#60 0x00000000008a5b82 in cselib_hasher::equal (v=0x2294170,
x_arg=0x7fffffffbef0)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:150
#61 0x00000000008a5d42 in hash_table<cselib_hasher, xcallocator,
false>::find_slot_with_hash (this=0x22d53e0, comparable=0x7fffffffbef0,
hash=13065,
insert=INSERT)
at /space/rguenther/src/svn/gcc-5-branch/gcc/hash-table.h:999
#62 0x00000000008a0761 in cselib_find_slot (mode=SImode, x=0x7ffff687c978,
hash=13065, insert=INSERT, memmode=VOIDmode)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:600
#63 0x00000000008a3b5f in cselib_lookup_1 (x=0x7ffff687c978, mode=SImode,
create=1, memmode=VOIDmode)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:2082
#64 0x00000000008a3c71 in cselib_lookup (x=0x7ffff687c978, mode=SImode,
create=1, memmode=VOIDmode)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:2125
#65 0x00000000008a478f in cselib_add_permanent_equiv (elt=0x2328960,
x=0x7ffff687c978, insn=0x7ffff68196c0)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:2427
#66 0x0000000001099612 in reverse_op (val=0x235e938, expr=0x7ffff681a6a8,
insn=0x7ffff68196c0)
at /space/rguenther/src/svn/gcc-5-branch/gcc/var-tracking.c:5846
#67 0x000000000109a4b6 in add_stores (loc=0x7ffff687c960, expr=0x7ffff681a6a8,
cuip=0x7fffffffc250)
---Type <return> to continue, or q <return> to quit---
at /space/rguenther/src/svn/gcc-5-branch/gcc/var-tracking.c:6114
#68 0x0000000000cfb3b0 in note_stores (x=0x7ffff681a6a8,
fun=0x1099617 <add_stores(rtx, const_rtx, void*)>, data=0x7fffffffc250)
at /space/rguenther/src/svn/gcc-5-branch/gcc/rtlanal.c:1652
#69 0x0000000000cfb3f7 in note_stores (x=0x7ffff680b680,
fun=0x1099617 <add_stores(rtx, const_rtx, void*)>, data=0x7fffffffc250)
at /space/rguenther/src/svn/gcc-5-branch/gcc/rtlanal.c:1657
#70 0x000000000109c929 in add_with_sets (insn=0x7ffff68196c0,
sets=0x7fffffffc350, n_sets=1)
at /space/rguenther/src/svn/gcc-5-branch/gcc/var-tracking.c:6559
#71 0x00000000008a4cf6 in cselib_record_sets (insn=0x7ffff68196c0)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:2574
#72 0x00000000008a52e6 in cselib_process_insn (insn=0x7ffff68196c0)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cselib.c:2686
#73 0x00000000010a7a79 in vt_initialize ()
at /space/rguenther/src/svn/gcc-5-branch/gcc/var-tracking.c:10132
#74 0x00000000010a82de in variable_tracking_main_1 ()
at /space/rguenther/src/svn/gcc-5-branch/gcc/var-tracking.c:10331
#75 0x00000000010a8408 in variable_tracking_main ()
at /space/rguenther/src/svn/gcc-5-branch/gcc/var-tracking.c:10384
Can't reproduce on trunk.
More information about the Gcc-bugs
mailing list