From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3B1D53857C44; Tue, 11 May 2021 03:12:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B1D53857C44 From: "haoxintu at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100512] New: [12 Regression] ICE during GIMPLE pass: cddce in mark_operand_necessary, at tree-ssa-dce.c:173 (under -O2 to -Os) Date: Tue, 11 May 2021 03:12:56 +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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: haoxintu at gmail dot com 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 keywords 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 May 2021 03:12:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100512 Bug ID: 100512 Summary: [12 Regression] ICE during GIMPLE pass: cddce in mark_operand_necessary, at tree-ssa-dce.c:173 (under -O2 to -Os) Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi all. $cat small.c #include int a; void b() { int16_t *c; uint16_t d =3D 2; if (0 =3D=3D d) { uint64_t e; uint64_t *f =3D &e; for (;;) { if (e +=3D 0 >=3D 0) for (;;) ; g: for (; a;) { int16_t i =3D &d; *c =3D i && *f; } } } goto g; } $gcc -w -O2=20 during GIMPLE pass: cddce small.c: In function =E2=80=98b=E2=80=99: small.c:21:1: internal compiler error: in mark_operand_necessary, at tree-ssa-dce.c:173 21 | } | ^ 0x65b30e mark_operand_necessary ../../gcc/tree-ssa-dce.c:173 0xc86d76 propagate_necessity ../../gcc/tree-ssa-dce.c:852 0xc86d76 perform_tree_ssa_dce ../../gcc/tree-ssa-dce.c:1673 0xc887d5 tree_ssa_cd_dce ../../gcc/tree-ssa-dce.c:1717 0xc887d5 execute ../../gcc/tree-ssa-dce.c:1789 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. tuhaoxin@oscar-2020:~/dut-research/covsmith-test/20210502$ cat small.c #include int a; void b() { int16_t *c; uint16_t d =3D 2; if (0 =3D=3D d) { uint64_t e; uint64_t *f =3D &e; for (;;) { if (e +=3D 0 >=3D 0) for (;;) ; g: for (; a;) { int16_t i =3D &d; *c =3D i && *f; } } } goto g; } $gcc -v Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/home/tuhaoxin/compilers/gcc/build/libexec/gcc/x86_64= -pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=3D/home/tuhaoxin/compilers/gcc/build/ --enable-bootstrap --enable-checking=3Drelease --enable-languages=3Dc,c++ -disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20210510 (experimental) (GCC)=20 This crash only exists in the current trunk version of GCC, and the released versions perform well. I also tested it on an earlier GCC trunk built on 20210425, it does not crash as well. So I think it's a regression issue in GCC-12. Thanks, Haoxin=