I get the following ICE with gcc 4.2. This is a regression from 4.0 and 4.1. (sid)17:tbm@usurper: ~] /usr/lib/gcc-snapshot/bin/gcc -c -O2 mini.c mini.c: In function 'GetCmd': mini.c:23: error: wrong amount of branch edges after unconditional jump 2 mini.c:23: 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. zsh: exit 1 /usr/lib/gcc-snapshot/bin/gcc -c -O2 mini.c (sid)18:tbm@usurper: ~] /usr/lib/gcc-snapshot/bin/gcc -c -O1 mini.c (sid)19:tbm@usurper: ~] gcc-4.1 -c -O2 mini.c (sid)20:tbm@usurper: ~] gcc-4.0 -c -O2 mini.c (sid)21:tbm@usurper: ~] cat mini.c short GetCmd () { int c, c1; for (c = 255; c == 255;) { c = GetMouseButton (); if (c >= 0) { c = ParsePos (c, -1, 0); c1 = ParsePos (c1, c, 1); if (c == c1 && (c >= 0 || c == -10)) { return c; } if (c >= 0 && c1 == -12) { return ((((((10) + 1) + 1)) + 1) << 7) | c; } c = 255; } } }
Confirmed. #0 internal_error (gmsgid=0x887a074 "verify_flow_info failed") at /space/rguenther/src/svn/trunk/gcc/diagnostic.c:586 #1 0x085fc3ab in verify_flow_info () at /space/rguenther/src/svn/trunk/gcc/cfghooks.c:227 #2 0x0871f6af in try_optimize_cfg (mode=1) at /space/rguenther/src/svn/trunk/gcc/cfgcleanup.c:2147 #3 0x0871f912 in cleanup_cfg (mode=1) at /space/rguenther/src/svn/trunk/gcc/cfgcleanup.c:2238 #4 0x083dfd84 in rest_of_handle_jump_bypass () at /space/rguenther/src/svn/trunk/gcc/gcse.c:6630
This appeared between 20060218 and 20060325.
This works for me with a cross to powerpc64-linux-gnu with "4.2.0 20060617". What target are you compiling this on?
On i686-linux, it fails.
The problem is that the edge from bb 2 has EDGE_EXECUTABLE flag set, which confuses verify_flow_info.
Patch: http://gcc.gnu.org/ml/gcc-patches/2006-06/msg01215.html
Subject: Bug 28121 Author: rakdver Date: Thu Jun 22 17:54:45 2006 New Revision: 114898 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114898 Log: PR rtl-optimization/28121 * cfgexpand.c (tree_expand_cfg): Clean EDGE_EXECUTABLE flag from the entry edge. * gcc.dg/pr28121.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr28121.c Modified: trunk/gcc/ChangeLog trunk/gcc/cfgexpand.c trunk/gcc/testsuite/ChangeLog
Fixed.