Bug 57400 - [4.9 Regression] ICE: verify_ssa failed (definition in block n follows the use)
Summary: [4.9 Regression] ICE: verify_ssa failed (definition in block n follows the use)
Status: RESOLVED DUPLICATE of bug 57393
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-24 17:33 UTC by Antoine Balestrat
Modified: 2013-09-23 09:08 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-07-01 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Balestrat 2013-05-24 17:33:44 UTC
Hello !
I'm using GCC 4.9.0 as of 20130524.

$ cat ssa.c
int a;

void f(void)
{
    int b;

    for(a = 0; a < 23; a++)
        b |= a > 0;

    a = !!b;
}

$ xgcc -O3 -w ssa.c
ssa.c: In function ‘f’:
ssa.c:3:6: error: definition in block 2 follows the use
 void f(void)
      ^
for SSA_NAME: _7 in statement:
b_34 = b_22 | _7;
ssa.c:3:6: 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.
Comment 1 Richard Biener 2013-05-27 08:43:36 UTC
Probably a dup.
Comment 2 Dmitry Gorbachev 2013-07-01 05:27:25 UTC
The following testcase causes a similar error / ICE (although I can't reproduce the bug with the original testcase).

======================== 8< ========================
extern void bar(double);

struct S {
  int n;
};

void foo(struct S s, double a, int i, int j, int k)
{
  struct S t;
  bar(s.n * a * i * j);
  t.n = s.n * a * i * k;
}
======================== >8 ========================

$ gcc -S -g -O -ffast-math bug.c
bug.c: In function 'foo':
bug.c:7:6: error: definition in block 2 follows the use
 void foo(struct S s, double a, int i, int j, int k)
      ^
for SSA_NAME: _4 in statement:
# DEBUG D#3 => _4 * _6
bug.c:7:6: internal compiler error: verify_ssa failed
0x888c299 verify_ssa(bool)
	../../gcc-4.9/gcc/tree-ssa.c:1046
0x85dc5ca execute_function_todo
	../../gcc-4.9/gcc/passes.c:1970
0x85db901 do_per_function
	../../gcc-4.9/gcc/passes.c:1707
0x85dc6df execute_todo
	../../gcc-4.9/gcc/passes.c:2002
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

GCC 4.9.0 20130630 (experimental).
Comment 3 Joost VandeVondele 2013-07-01 10:36:00 UTC
(In reply to Dmitry Gorbachev from comment #2)
> The following testcase causes a similar error / ICE (although I can't
> reproduce the bug with the original testcase).

this second testcase is almost certainly a dup of PR57393. It passes with -fno-tree-reassoc. The testcase is conveniently smaller.

I assume it is caused (see also PR57370):
http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=199048


The original testcase of this PR still fails for me (and also passes with -fno-tree-reassoc).
Comment 4 Richard Biener 2013-09-23 09:08:26 UTC
Dup.

*** This bug has been marked as a duplicate of bug 57393 ***