[ Forwarded from http://bugs.debian.org/376084 ] We're seeing the following ICE on ia64 with gcc 4.1: merulo% g++-4.1 -c -O2 000.c 000.c: In member function 'k3d::mesh* libk3dprimitives::lawn_implementation::on_create_geometry()': 000.c:7597: internal compiler error: in add_insn_before, at emit-rtl.c:3479 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>. Preprocessed source stored into /tmp/ccifNJOx.out file, please attach this to your bugreport. merulo% g++-4.1 -c -O1 000.c merulo% g++-4.0 -c -O2 000.c merulo% /usr/lib/gcc-snapshot/bin/g++ -c -O2 000.c merulo%
Created attachment 11798 [details] test case
With checking enabled we have obj2/gcc> ./cc1plus -quiet -O2 t.ii t.ii: In static member function 'static IntType boost::random::const_mod<IntType, m>::mult_schrage(IntType, IntType) [with IntType = int, IntType m = 2147483647]': t.ii:7335: error: too many outgoing branch edges from bb 3 t.ii:7335: internal compiler error: verify_flow_info failed Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. maybe related to PR27291.
Created attachment 11843 [details] testcase reduced C++ testcase attached. C testcase: void foo(void) { int value47D2367, valueD2287; unsigned int jD2283; value47D2367 = x->x; jD2283 = 0; L0: if (value47D2367 > 0) goto L3; else goto L17; L17: valueD2287 = value47D2367; L2: valueD2287 = valueD2287 + 2147483647; if (valueD2287 > 0) goto L3; else goto L2; L3: jD2283 = jD2283 + 1; if (jD2283 != 607) goto L0; else goto L6; L6: return; } gcc> ./cc1 -O2 -quiet t.i t.i: In function 'foo': t.i:26: error: NOTE_INSN_BASIC_BLOCK is missing for block 8 t.i:26: error: NOTE_INSN_BASIC_BLOCK 92 in middle of basic block 8 t.i:26: error: too many outgoing branch edges from bb 2 t.i:26: internal compiler error: verify_flow_info failed Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
So, confirmed.
The reduced testcases are with checking only.
ICE is after rtl loop2 optimizer, looks like it requires a doloop target.
Really looks like a dup of PR27291, but the patch for that doesn't apply to the 4.1 branch.
If we apply the patch from http://gcc.gnu.org/ml/gcc-patches/2005-11/msg02094.html first then we can apply the patch for PR 27291. I did this on the 4.1 branch and the bug went away. I have not done a full bootstrap with the two patches but will do that over the weekend.
Created attachment 11967 [details] patch combined and bootstrapped with the two patches mentioned in #8 with no regressions on i486-linux-gnu. Matthias
My weekend bootstrapping and testing on ia64-hp-hpux11.23 and ia64 Linux on the 4.1 branch showed no regressions. I think I should send email to gcc-patches before checking it in on the 4.1 branch since the first patch is not technically a regression fix. Unless someone else wants to handle the checkin on the 4.1 branch?
Subject: Bug 28221 Author: sje Date: Thu Aug 3 16:35:31 2006 New Revision: 115904 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115904 Log: PR rtl-optimization/28221 Backport from mainline. 2005-11-30 Nathan Sidwell <nathan@codesourcery.com> * loop-doloop.c (add_test): Only add jump note if we did emit a jump. 2006-05-01 Zdenek Dvorak <dvorakz@suse.cz> PR rtl-optimization/27291 * loop-doloop.c (add_test, doloop_modify): Handle the case condition is folded to a constant. Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/loop-doloop.c
Fixed by backporting Nathan's patch and the fix for PR 27291.