https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87469
Bug ID: 87469 Summary: ice in record_estimate, at tree-ssa-loop-niter.c:3271 Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Target Milestone: --- For this C++ source code: long a; struct c { void d(unsigned f) { long e = f; while (e & e - 1) e &= e - 1; a = e; } }; void g() { c b; b.d(4 + 2); } compiled by recent gcc trunk and compiler flag -O2, does this: $ ~/gcc/results/bin/gcc -c -w -O2 bug466.cc during GIMPLE pass: cunrolli bug466.cc: In function ‘void g()’: bug466.cc:10:6: internal compiler error: in record_estimate, at tree-ssa-loop-niter.c:3271 10 | void g() { | ^ 0x10bc8da record_estimate ../../trunk/gcc/tree-ssa-loop-niter.c:3271 0x10c391b estimate_numbers_of_iterations(loop*) ../../trunk/gcc/tree-ssa-loop-niter.c:4122 0x10c4c0c estimate_numbers_of_iterations(function*) ../../trunk/gcc/tree-ssa-loop-niter.c:4342 0x109e88e tree_unroll_loops_completely ../../trunk/gcc/tree-ssa-loop-ivcanon.c:1424 The problem seems to first occur somewhere between revisions 261000 and 262000.