Bug 28121 - [4.2 regression] verify_flow_info failed (wrong amount of branch edges after unconditional jump 2)
Summary: [4.2 regression] verify_flow_info failed (wrong amount of branch edges after ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Zdenek Dvorak
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code, patch
Depends on:
Blocks:
 
Reported: 2006-06-21 10:49 UTC by Martin Michlmayr
Modified: 2006-06-23 03:26 UTC (History)
4 users (show)

See Also:
Host:
Target: i686-*-*
Build:
Known to work: 4.0.4 4.1.1
Known to fail:
Last reconfirmed: 2006-06-21 14:37:01


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2006-06-21 10:49:50 UTC
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;
        }
    }
}
Comment 1 Richard Biener 2006-06-21 11:59:33 UTC
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
Comment 2 Martin Michlmayr 2006-06-21 13:37:44 UTC
This appeared between 20060218 and 20060325.
Comment 3 Andrew Pinski 2006-06-21 14:22:16 UTC
This works for me with a cross to powerpc64-linux-gnu with "4.2.0 20060617".  What target are you compiling this on?
Comment 4 Zdenek Dvorak 2006-06-21 14:26:24 UTC
On i686-linux, it fails.
Comment 5 Zdenek Dvorak 2006-06-21 14:37:01 UTC
The problem is that the edge from bb 2 has EDGE_EXECUTABLE flag set, which confuses verify_flow_info.
Comment 6 Zdenek Dvorak 2006-06-21 23:15:35 UTC
Patch: http://gcc.gnu.org/ml/gcc-patches/2006-06/msg01215.html
Comment 7 Zdenek Dvorak 2006-06-22 17:54:54 UTC
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

Comment 8 Andrew Pinski 2006-06-23 03:26:16 UTC
Fixed.