Bug 43781 - [4.6 Regression] ice: verify_ssa failed
Summary: [4.6 Regression] ice: verify_ssa failed
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-18 03:02 UTC by John Regehr
Modified: 2011-04-26 08:47 UTC (History)
4 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2010-04-18 17:23:26


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Regehr 2010-04-18 03:02:36 UTC
[regehr@gamow tmp405]$ current-gcc -c -O2 small.c
small.c: In function 'int32func':
small.c:26:1: error: definition in block 8 follows the use
for SSA_NAME: g_313.0_6 in statement:
# VUSE <.MEM_22>
g_313.8_12 = *g_313.0_6;
small.c:26:1: internal compiler error: verify_ssa failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[regehr@gamow tmp405]$ cat small.c

typedef int int32_t;
typedef unsigned char uint8_t;

struct S0
{
  uint8_t f3;
};

struct S2
{
  uint8_t f5;
};

struct S0 g_22 = {
  0
};

int32_t g_91;
const struct S2 *g_314;
const struct S2 **g_313 = &g_314;
struct S2 g_320[2] = {
  0
};

void
int32func (uint64p_34)
{
  for (g_22.f3 = 0; g_22.f3 <= 0; g_22.f3)
    {
    lbl_491:{
	if (1)
	  {
	    int32_t *l_453[2][7][7][1][1];
	    int i, j, k, l, m;
	    for (m; m; m++)
	      l_453[i][j][k][l][m];
	  }
	*g_313 = 0;
	if (g_91)
	  goto lbl_491;
      }
    }
}

[regehr@gamow tmp405]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r158448-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto --prefix=/home/regehr/z/compiler-install/gcc-r158448-install --program-prefix=r158448- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100416 (experimental) (GCC)
Comment 1 H.J. Lu 2010-04-18 15:20:10 UTC
It is caused by revision 158380:

http://gcc.gnu.org/ml/gcc-cvs/2010-04/msg00486.html
Comment 2 Richard Biener 2010-04-18 20:14:53 UTC
Loop invariant motion breaks this.

 <bb 6>:
-  g_313.0_6 = pretmp.4_9;
-  *g_313.0_6 = 0B;

 <bb 8>:
   # m_21 = PHI <0(11), m_3(D)(2)>
+  g_313.8_12 = *g_313.0_6;
+  g_313.0_6 = pretmp.4_9;
   goto <bb 5>;

we insert stmts not preserving ordering.
Comment 3 Richard Biener 2010-06-28 11:53:37 UTC
I can no longer reproduce this.
Comment 4 hjl@gcc.gnu.org 2010-06-28 17:26:09 UTC
Subject: Bug 43781

Author: hjl
Date: Mon Jun 28 17:25:49 2010
New Revision: 161505

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161505
Log:
Add a testcase for PR tree-optimization/43781.

2010-06-28  H.J. Lu  <hongjiu.lu@intel.com>

	PR tree-optimization/43781
	* gcc.dg/torture/pr43781.c: New.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr43781.c
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 5 Jakub Jelinek 2011-04-26 08:11:42 UTC
This has been fixed or made latent by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159100
Comment 6 Richard Biener 2011-04-26 08:47:22 UTC
I'd say made latent.