From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DA2CF3858C50; Thu, 16 Feb 2023 10:35:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA2CF3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676543707; bh=PTYGnfOO3fVS3mtTTPVWy6eZgujWmgtSU6nYJ8ty86g=; h=From:To:Subject:Date:From; b=ati8teOGavC4i5J7/k4RaqUs6T7VuikTLoVYBJz5E9KQPW6noMa01zw1nR4cRTA9g ON7bSXfH0/D+kfx8tXNJ4NSYpDE+xBOVtjpO2ZI0are//8Wdh9wYwYFUcuQkxD8jux CWtUUn0z2zENBgH8s5cWgAOskAQ7w3JKa6Wtk5/w= From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108819] New: ICE on valid code at -O1 with "-fno-tree-ccp -fno-tree-forwprop" on x86_64-linux-gnu: tree check: expected ssa_name, have integer_cst in number_of_iterations_cltz, at tree-ssa-loop-niter.cc:2394 Date: Thu, 16 Feb 2023 10:35:07 +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=3D108819 Bug ID: 108819 Summary: ICE on valid code at -O1 with "-fno-tree-ccp -fno-tree-forwprop" on x86_64-linux-gnu: tree check: expected ssa_name, have integer_cst in number_of_iterations_cltz, at tree-ssa-loop-niter.cc:2394 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.=20 Compiler Explorer: https://godbolt.org/z/a7zzhcxhz [570] % 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 20230216 (experimental) [master r13-6073-g441c466fd4d] (= GCC) [571] % [571] % gcctk -O1 small.c; ./a.out [572] % [572] % gcctk -O1 -fno-tree-ccp -fno-tree-forwprop small.c during GIMPLE pass: ivcanon small.c: In function =E2=80=98main=E2=80=99: small.c:2:5: internal compiler error: tree check: expected ssa_name, have integer_cst in number_of_iterations_cltz, at tree-ssa-loop-niter.cc:2394 2 | int main() { | ^~~~ 0x7a8f41 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc-trunk/gcc/tree.cc:8909 0x78196d tree_check(tree_node*, char const*, int, char const*, tree_code) ../../gcc-trunk/gcc/tree.h:3530 0x78196d number_of_iterations_cltz ../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:2394 0x10838e2 number_of_iterations_exit_assumptions(loop*, edge_def*, tree_niter_desc*, gcond**, bool, basic_block_def**) ../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:3287 0x10838e2 number_of_iterations_exit(loop*, edge_def*, tree_niter_desc*, boo= l, bool, basic_block_def**) ../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:3274 0x1083e08 estimate_numbers_of_iterations(loop*) ../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:4844 0x1086685 estimate_numbers_of_iterations(function*) ../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:5072 0x105aad6 canonicalize_induction_variables() ../../gcc-trunk/gcc/tree-ssa-loop-ivcanon.cc:1293 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. [573] % [573] % cat small.c int a, b; int main() { int d =3D 1; for (; b; b++) if (a < 1) while (d <=3D a && a <=3D 0UL) { int *e =3D &d; *e =3D 0; } return 0; }=