From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3CFE13858C50; Wed, 5 Apr 2023 07:54:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CFE13858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680681269; bh=3nhJKjxK2lA90V5JjA+WmGy5mlbi07hO6Y4GWl7B/xk=; h=From:To:Subject:Date:From; b=vJbMYyFeZAsGoixil821hX2OO4B3ljG8O5YwXhf0lTpMSePiNflwRWT5dYwjaz/N5 aFv2g0/fLegor1fW3jXthyXaTfwDHyR76L/k0Yndb/a8QG/G6z9gwVAzqItphBK6W8 S8hQAIhz0H1/uj4JYwDcG3AI0MyNxubhhxd2VjCs= From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109417] New: ICE on valid code at -O3 on x86_64-linux-gnu: Segmentation fault Date: Wed, 05 Apr 2023 07:54:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhendong.su at inf dot ethz.ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109417 Bug ID: 109417 Summary: ICE on valid code at -O3 on x86_64-linux-gnu: Segmentation fault Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zhendong.su at inf dot ethz.ch Target Milestone: --- This appears to be a recent regression. Compiler Explorer: https://godbolt.org/z/eM6aG1aYc [605] % gcctk -v Using built-in specs. COLLECT_GCC=3Dgcctk COLLECT_LTO_WRAPPER=3D/local/suz-local/software/local/gcc-trunk/libexec/gcc= /x86_64-pc-linux-gnu/13.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --enable-checking=3Dyes --prefix=3D/local/suz-local/software/local/gcc-trunk --enable-sanitizers --enable-languages=3Dc,c++ --disable-werror --enable-mu= ltilib --with-system-zlib Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.0.1 20230405 (experimental) [master r13-7008-gfdc5abbdcfb] (= GCC) [606] % [606] % gcctk -O2 small.c; ./a.out [607] % [607] % gcctk -O3 small.c during GIMPLE pass: vrp small.c: In function =E2=80=98main=E2=80=99: small.c:3:5: internal compiler error: Segmentation fault 3 | int main() { | ^~~~ 0xeeb4bf crash_signal ../../gcc-trunk/gcc/toplev.cc:314 0x1cea605 gori_compute::may_recompute_p(tree_node*, basic_block_def*, int) ../../gcc-trunk/gcc/gimple-range-gori.cc:1322 0x1cda775 ranger_cache::range_from_dom(vrange&, tree_node*, basic_block_def= *, ranger_cache::rfd_mode) ../../gcc-trunk/gcc/gimple-range-cache.cc:1462 0x1cdc8e0 ranger_cache::range_from_dom(vrange&, tree_node*, basic_block_def= *, ranger_cache::rfd_mode) ../../gcc-trunk/gcc/gimple-range-cache.cc:1426 0x1cdc8e0 ranger_cache::fill_block_cache(tree_node*, basic_block_def*, basic_block_def*) ../../gcc-trunk/gcc/gimple-range-cache.cc:1212 0x1cdd5a4 ranger_cache::block_range(vrange&, basic_block_def*, tree_node*, bool) ../../gcc-trunk/gcc/gimple-range-cache.cc:1039 0x1cd3ce8 gimple_ranger::range_on_entry(vrange&, basic_block_def*, tree_nod= e*) ../../gcc-trunk/gcc/gimple-range.cc:156 0x11bde4a remove_unreachable::remove_and_update_globals(bool) ../../gcc-trunk/gcc/tree-vrp.cc:156 0x11c066d remove_unreachable::remove_and_update_globals(bool) ../../gcc-trunk/gcc/tree-vrp.cc:1104 0x11c066d execute_ranger_vrp(function*, bool, bool) ../../gcc-trunk/gcc/tree-vrp.cc:1104 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. [608] % [608] % cat small.c int printf(const char *, ...); int c, d, *e, f[1][2], g; int main() { int h =3D 0, *a =3D &h, **b[1] =3D {&a}; while (e) while (g) { L: for (h =3D 0; h < 2; h++) { while (d) for (*e =3D 0; *e < 1;) printf("0"); while (c) ; f[g][h] =3D 0; } } if (h) goto L; return 0; }=