From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 656273858D32; Wed, 1 Nov 2023 11:26:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 656273858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698837987; bh=m5N/ghzw2H3YTHREnvNl3gJjCE4VXPgUSaUXxglJuzY=; h=From:To:Subject:Date:From; b=B+LooIlnmFn0GGRcGe6oZkEE4WmXklZnyfN23FekyVKQAdGxKn6MDsA/9IEQpkC+q SifvIR005ONjgjXfcd/JkdNZ6+NV0vy9Ml222xCccNJBj33iIf6808xhJUEcNPJufc 8MYPllLjIDPYKpPvCF7njJmvf767d/7ofY7j4diM= From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112333] New: ICE on valid code at -O2 and -O3: Segmentation fault Date: Wed, 01 Nov 2023 11:26:24 +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=3D112333 Bug ID: 112333 Summary: ICE on valid code at -O2 and -O3: 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: --- It appears to be a recent regression. Compiler Explorer: https://godbolt.org/z/z8fo6PvPh=20 With my local build, -g is needed to reproduce the ICE.=20 [512] % 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/14.0.0/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 Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 20231101 (experimental) (GCC)=20 [513] %=20 [513] % gcctk -O3 -g small.c during GIMPLE pass: ccp small.c: In function =E2=80=98main=E2=80=99: small.c:3:5: internal compiler error: Segmentation fault 3 | int main() { | ^~~~ 0x111dc93 crash_signal ../../gcc-trunk/gcc/toplev.cc:315 0x7f658ef6c08f ??? =20=20=20=20=20=20=20 /build/glibc-BHL3KM/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sig= action.c:0 0xd70a7b gsi_for_stmt(gimple*) ../../gcc-trunk/gcc/gimple-iterator.cc:615 0x13a2e72 insert_debug_temp_for_var_def(gimple_stmt_iterator*, tree_node*) ../../gcc-trunk/gcc/tree-ssa.cc:471 0x13a329a insert_debug_temps_for_defs(gimple_stmt_iterator*) ../../gcc-trunk/gcc/tree-ssa.cc:506 0xd707e4 gsi_remove(gimple_stmt_iterator*, bool) ../../gcc-trunk/gcc/gimple-iterator.cc:567 0x12624c2 simple_dce_from_worklist(bitmap_head*, bitmap_head*) ../../gcc-trunk/gcc/tree-ssa-dce.cc:2206 0x1314c1a substitute_and_fold_engine::substitute_and_fold(basic_block_def*) ../../gcc-trunk/gcc/tree-ssa-propagate.cc:1001 0x1242db8 ccp_finalize ../../gcc-trunk/gcc/tree-ssa-ccp.cc:1031 0x1243468 do_ssa_ccp ../../gcc-trunk/gcc/tree-ssa-ccp.cc:2980 0x1243468 execute ../../gcc-trunk/gcc/tree-ssa-ccp.cc:3025 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. [514] %=20 [514] % cat small.c int printf(const char *, ...); int a, b, c, d, e; int main() { long g; int h =3D a, i; if (e) goto j; i =3D 0; for (; i < 1; i++) { int k =3D d | c, l =3D ~a; if (k) { m: e =3D 0; j: b =3D l; if (c) goto m; } } if (a) { while (a > 1) a--; g =3D a; printf("%d", h); } while (a) ; return 0; }=