Bug 95761 - [11 regression] ICE during GIMPLE pass: slp verify_ssa failed
Summary: [11 regression] ICE during GIMPLE pass: slp verify_ssa failed
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: 11.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-19 07:25 UTC by Dmitry G. Dyachenko
Modified: 2020-06-24 06:51 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-06-19 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry G. Dyachenko 2020-06-19 07:25:18 UTC
r11-1451 PASS
r11-1512 FAIL

`gcc -O2' PASS

$ gcc -O3 -c x_1.i
x_1.i: In function 'k':
x_1.i:10:6: error: definition in block 3 follows the use
   10 | void k() {
      |      ^
for SSA_NAME: vect__2.17_23 in statement:
vect__124.21_25 = vect_cst__58 + vect__2.17_23;
during GIMPLE pass: slp
x_1.i:10:6: internal compiler error: verify_ssa failed
0x123ff3d verify_ssa(bool, bool)
	/home/dimhen/src/gcc_current/gcc/tree-ssa.c:1208
0xf37d25 execute_function_todo
	/home/dimhen/src/gcc_current/gcc/passes.c:1992
0xf38a5c do_per_function
	/home/dimhen/src/gcc_current/gcc/passes.c:1640
0xf38a5c execute_todo
	/home/dimhen/src/gcc_current/gcc/passes.c:2039
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ cat x_1.i
typedef int a[10];
typedef struct {
  a b;
  a c;
  a d;
  a e;
} f;
f g;
int *j;
void k() {
  for (;;) {
    a l;
    j[0] = g.b[0];
    int *h = g.d;
    int i = 0;
    for (; i < 10; i++)
      h[i] = l[0] - g.e[0];
    h = g.e;
    i = 0;
    for (; i < 10; i++)
      h[i] = l[1] + g.e[i];
  }
}

Sorry for hyper-reduction
Comment 1 Richard Biener 2020-06-19 07:46:54 UTC
Mine.
Comment 2 Martin Liška 2020-06-19 07:49:56 UTC
For the record: started with r11-1501-gda2b7c7f0a136b4d.
Comment 3 GCC Commits 2020-06-19 11:37:04 UTC
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:f8f5715606a4a455327874847ccc91f4617bb4de

commit r11-1553-gf8f5715606a4a455327874847ccc91f4617bb4de
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jun 19 10:03:46 2020 +0200

    tree-optimization/95761 - fix vector insertion place compute
    
    I missed that indeed SLP permutation code generation can end up
    refering to a non-last vectorized stmt in the last SLP_TREE_VEC_STMTS
    element as optimization.  So walk them all.
    
    2020-06-19  Richard Biener  <rguenther@suse.de>
    
            PR tree-optimization/95761
            * tree-vect-slp.c (vect_schedule_slp_instance): Walk all
            vectorized stmts for finding the last one.
    
            * gcc.dg/torture/pr95761.c: New testcase.
Comment 4 Richard Biener 2020-06-19 11:37:31 UTC
Fixed.
Comment 5 Dmitry G. Dyachenko 2020-06-19 17:17:06 UTC
r11-1553 PASS original testcase for me.
And FAIL similar test with the same stack.

$ cat x_2.i
typedef int a[10];
typedef struct {
  a b;
  a c;
  a d;
} e;
e j;
void k() {
  int *h = j.c, *f = j.d, *g = j.b;
  int i;
  for (i = 0; i < 10; i++)
    h[i] = f[0] + g[0];
  {
    h = j.d;
    for (i = 0; i < 10; i++)
      h[i] = f[1] - g[0];
    h = 0;
    h[0] = 0;
  }
  k();
}

gcc -O3 -fpreprocessed -c x_2.i 
x_2.i: In function 'k':
x_2.i:8:6: error: definition in block 2 follows the use
    8 | void k() {
      |      ^
for SSA_NAME: vect_cst__14 in statement:
vect__31.16_9 = vect_cst__14 - vect__127.14_155;
during GIMPLE pass: slp
x_2.i:8:6: internal compiler error: verify_ssa failed
0x12407cd verify_ssa(bool, bool)
	/home/dimhen/src/gcc_current/gcc/tree-ssa.c:1208
0xf385b5 execute_function_todo
	/home/dimhen/src/gcc_current/gcc/passes.c:1992
0xf392ec do_per_function
	/home/dimhen/src/gcc_current/gcc/passes.c:1640
0xf392ec execute_todo
	/home/dimhen/src/gcc_current/gcc/passes.c:2039
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


test from PR95770 FAIL too for me
Comment 6 Dmitry G. Dyachenko 2020-06-22 15:36:59 UTC
r11-1582 PASS for me x_2.i and original (non-reduced) compilation
Comment 7 Martin Liška 2020-06-23 19:40:52 UTC
I see the test-cases fixed.
Can you still reproduce that?
Comment 8 Dmitry G. Dyachenko 2020-06-24 06:51:57 UTC
(In reply to Martin Liška from comment #7)
> I see the test-cases fixed.
> Can you still reproduce that?

r11-1553 PASS x_1.i for me and FAIL unreduced one.
r11-1582 PASS x_1.i, x_2.i for me and PASS unreduced.

Thanks