aarch64-linux profiledbootstrap --enable-checking=release currently fails: /builddir/build/BUILD/gcc-9.0.1-20190309/obj-aarch64-redhat-linux/./prev-gcc/xg++ -B/builddir/build/BUILD/gcc-9.0.1-20190309/obj-aarch64-redhat-linux/./prev-gcc/ -B/usr/aarch64-redhat-linux/bin/ -nostdinc++ -B/builddir/build/BUILD/gcc-9.0.1-20190309/obj-aarch64-redhat-linux/prev-aarch64-redhat-linux/libstdc++-v3/src/.libs -B/builddir/build/BUILD/gcc-9.0.1-20190309/obj-aarch64-redhat-linux/prev-aarch64-redhat-linux/libstdc++-v3/libsupc++/.libs -I/builddir/build/BUILD/gcc-9.0.1-20190309/obj-aarch64-redhat-linux/prev-aarch64-redhat-linux/libstdc++-v3/include/aarch64-redhat-linux -I/builddir/build/BUILD/gcc-9.0.1-20190309/obj-aarch64-redhat-linux/prev-aarch64-redhat-linux/libstdc++-v3/include -I/builddir/build/BUILD/gcc-9.0.1-20190309/libstdc++-v3/libsupc++ -L/builddir/build/BUILD/gcc-9.0.1-20190309/obj-aarch64-redhat-linux/prev-aarch64-redhat-linux/libstdc++-v3/src/.libs -L/builddir/build/BUILD/gcc-9.0.1-20190309/obj-aarch64-redhat-linux/prev-aarch64-redhat-linux/libstdc++-v3/libsupc++/.libs -c -O2 -g -Wall -Wformat-security -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fprofile-use -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include -I../../gcc/../libcpp/include \ -o build/genoutput.o ../../gcc/genoutput.c virtual memory exhausted: Cannot allocate memory The problem is that during dom when processing: <bb 9> [count: 0]: # p0_9 = PHI <""(93)> # DEBUG p0 => "" # DEBUG BEGIN_STMT # DEBUG D#80 => MEM[(struct operand_data *)d_28(D) + 72B].predicate # DEBUG p1 => D#80 # DEBUG BEGIN_STMT # DEBUG p1 => pretmp_83 # DEBUG BEGIN_STMT _81 = strcmp (p0_9, pretmp_83); if (_81 != 0) goto <bb 20>; [42.83%] else goto <bb 10>; [57.17%] we fold_stmt _81 = strcmp (p0_9, pretmp_83); into _17 = MEM[(const unsigned char * {ref-all})pretmp_83]; _167 = (int) _17; _81 = -_167; but vr_values has been constructed with num_vr_values of 167 and when we try to optimize_stmt the folded _167 = (int) _17, we first ask for value range of _167 and get: /* If we query the range for a new SSA name return an unmodifiable VARYING. We should get here at most from the substitute-and-fold stage which will never try to change values. */ if (ver >= num_vr_values) return CONST_CAST (value_range *, &vr_const_varying); and then update_value_range to the [0, 255] range derived from the stmt. That modifies the shared const vr_const_varying variable and all goes wrong from there.
Created attachment 45935 [details] gcc9-pr89656.patch Untested fix.
Hi Jakub, The above patch fixes ICE on building linux kernel for arm (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89655)
Created attachment 45936 [details] gcc9-pr89656.patch Updated patch with the reduced testcase from PR89655.
Author: jakub Date: Mon Mar 11 21:58:43 2019 New Revision: 269597 URL: https://gcc.gnu.org/viewcvs?rev=269597&root=gcc&view=rev Log: PR middle-end/89655 PR bootstrap/89656 * vr-values.c (vr_values::update_value_range): If old_vr->varying_p (), don't update it, make new_vr also VARYING and return false. * gcc.c-torture/compile/pr89655.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr89655.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/vr-values.c
Fixed.
Author: rguenth Date: Mon May 6 12:40:18 2019 New Revision: 270907 URL: https://gcc.gnu.org/viewcvs?rev=270907&root=gcc&view=rev Log: 2019-05-06 Richard Biener <rguenther@suse.de> PR bootstrap/90359 Backport from mainline 2019-03-11 Jakub Jelinek <jakub@redhat.com> PR middle-end/89655 PR bootstrap/89656 * vr-values.c (vr_values::update_value_range): If old_vr->varying_p (), don't update it, make new_vr also VARYING and return false. * gcc.c-torture/compile/pr89655.c: New test. Added: branches/gcc-8-branch/gcc/testsuite/gcc.c-torture/compile/pr89655.c Modified: branches/gcc-8-branch/gcc/ChangeLog branches/gcc-8-branch/gcc/testsuite/ChangeLog branches/gcc-8-branch/gcc/vr-values.c