[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #11 from Richard Biener  ---
Fixed.

[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

--- Comment #10 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:22175d0dc6a89ddd630f19d0f32a2d1ddb046807

commit r11-4787-g22175d0dc6a89ddd630f19d0f32a2d1ddb046807
Author: Richard Biener 
Date:   Thu Nov 5 12:34:42 2020 +0100

tree-optimization/97706 - handle PHIs in pattern recog mask precison

This adds handling of PHIs to mask precision compute which is
eventually needed to detect a bool pattern when the def chain
contains such a PHI node.

2020-11-06  Richard Biener  

PR tree-optimization/97706
* tree-vect-patterns.c (possible_vector_mask_operation_p):
PHIs are possible mask operations.
(vect_determine_mask_precision): Handle PHIs.
(vect_determine_precisions): Walk PHIs in BB analysis.

* gcc.dg/vect/bb-slp-pr97706.c: New testcase.

[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

--- Comment #9 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:7307d8e10727aea8069c0e47e64a7a9b8588a22e

commit r11-4776-g7307d8e10727aea8069c0e47e64a7a9b8588a22e
Author: Richard Biener 
Date:   Fri Nov 6 11:11:42 2020 +0100

tree-optimization/97706 - part one, refactor vect_determine_mask_precision

This computes vect_determine_mask_precision in a RPO forward walk
rather than in a backward walk and using a worklist.  It will make
fixing PR97706 easier but for bisecting I wanted it to be separate.

2020-11-06  Richard Biener  

PR tree-optimization/97706
* tree-vect-patterns.c (vect_determine_mask_precision):
Remove worklist operation.
(vect_determine_stmt_precisions): Do not call
vect_determine_mask_precision here.
(vect_determine_precisions): Compute mask precision
in a forward walk.

[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

--- Comment #8 from Richard Biener  ---
OK, so we'd indeed need to handle PHIs in vect_recog_bool_pattern which might
turn out a bit complicated.  I'm not a fan of pattern detection for SLP
vectorization anyway so I'll see what to do here.

[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

--- Comment #7 from Richard Biener  ---
OK, so for the stores in the loop we end up with a bool pattern for the store
we don't support (eh):

t.i:24:14: note:   Starting SLP discovery for
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[0]) = patt_88;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[1]) = patt_87;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[2]) = patt_30;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[3]) = patt_28;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[4]) = patt_26;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[5]) = patt_24;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[6]) = patt_22;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[7]) = patt_20;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[8]) = patt_18;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[9]) = patt_16;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[10]) = patt_14;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[11]) = patt_12;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[12]) = patt_10;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[13]) = patt_8;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[14]) = patt_6;
t.i:24:14: note: VIEW_CONVERT_EXPR(arr[15]) = patt_4;
t.i:24:14: note:   Build SLP for VIEW_CONVERT_EXPR(arr[0]) =
patt_88;
t.i:24:14: note:   get vectype for scalar type (group size 16): _Bool
t.i:24:14: note:   vectype: vector(16) unsigned char
t.i:24:14: note:   nunits = 16
t.i:24:14: missed:   Build SLP failed: operation unsupported
VIEW_CONVERT_EXPR(arr[0]) = patt_88;
t.i:24:14: note:   SLP discovery failed

where the issue is that we have pattern detection follow DR group analysis
for SLP vectorization so the above do not look as DR group to
vect_analyze_slp_instance_1.

[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

--- Comment #6 from Richard Biener  ---
I guess we're missing what usually is done by bool patterns here, namely
adding a conversion from the mask vector type produced by the comparison
to the value vector type.

A simple workaround would be to reject such PHIs but I wonder how many
other uses prevail.  I don't remember why we chose to assign a mask
vector type to the LHS of the comparisons.

For the SSE case adding compensation via a VIEW_CONVERT_EXPR is possible
but for the AVX512 mask case that's more involved:

> ./cc1 -quiet t.i -O3 -fdump-tree-slp-details -mavx512f -mavx512vl -mavx512bw 
t.i: In function 'foo':
t.i:3:6: error: incompatible types in 'PHI' argument 0
3 | void foo(int n, char *p)
  |  ^~~
vector(16) unsigned char

vector(16) 

vect_b0_104.7_123 = PHI 

need to think about this.

[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #5 from Richard Biener  ---
Testcase that fails on x86_64 as well:

_Bool arr[16];
void bar();
void foo(int n, char *p)
{
  _Bool b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15;
  do
{
  b0 = p[0] != 0;
  b1 = p[1] != 0;
  b2 = p[2] != 0;
  b3 = p[3] != 0;
  b4 = p[4] != 0;
  b5 = p[5] != 0;
  b6 = p[6] != 0;
  b7 = p[7] != 0;
  b8 = p[8] != 0;
  b9 = p[9] != 0;
  b10 = p[10] != 0;
  b11 = p[11] != 0;
  b12 = p[12] != 0;
  b13 = p[13] != 0;
  b14 = p[14] != 0;
  b15 = p[15] != 0;
  arr[0] = b0;
  arr[1] = b1;
  arr[2] = b2;
  arr[3] = b3;
  arr[4] = b4;
  arr[5] = b5;
  arr[6] = b6;
  arr[7] = b7;
  arr[8] = b8;
  arr[9] = b9;
  arr[10] = b10;
  arr[11] = b11;
  arr[12] = b12;
  arr[13] = b13;
  arr[14] = b14;
  arr[15] = b15;
  bar ();
}
  while (--n);
  arr[0] = b0;
  arr[1] = b1;
  arr[2] = b2;
  arr[3] = b3;
  arr[4] = b4;
  arr[5] = b5;
  arr[6] = b6;
  arr[7] = b7;
  arr[8] = b8;
  arr[9] = b9;
  arr[10] = b10;
  arr[11] = b11;
  arr[12] = b12;
  arr[13] = b13;
  arr[14] = b14;
  arr[15] = b15;
}

[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-04 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

Martin Liška  changed:

   What|Removed |Added

 Status|WAITING |NEW
 CC||marxin at gcc dot gnu.org
   Priority|P3  |P1

--- Comment #4 from Martin Liška  ---
I can reproduce it on an aarch64 machine. GIMPLE FE test-case is not possible,
there are too many errors.
@Richi: Please use any of machines we have: needle.suse.cz, or
oolchainarm.arch.suse.de.

[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

Richard Biener  changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org,
   ||rsandifo at gcc dot gnu.org

--- Comment #3 from Richard Biener  ---
Eventually a GIMPLE testcase to fix_loops might produce a non-LTO testcase.

[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|WAITING

--- Comment #2 from Richard Biener  ---
Hmm, please specify how you configured.  I do

../src/trunk/configure --target=aarch64-suse-linux

and that doesn't suffice.  Any cpu/fpu selection?

As I'm using a cross I do not have libc and thus no runtime objects to link
against and thus trying

> ./xgcc -B. f1.c f2.c -flto -O3 -r -flinker-output=nolto-rel

which works fine.  Tried with -march=armv8.2-a+sve as well.

[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

Richard Biener  changed:

   What|Removed |Added

   Last reconfirmed||2020-11-04
 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Richard Biener  ---
I will have a look.

[Bug tree-optimization/97706] [11 Regression] ICE with LTO at -O3: verify_gimple failed (incompatible types in 'PHI' argument 0)

2020-11-03 Thread acoplan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97706

Alex Coplan  changed:

   What|Removed |Added

   Target Milestone|--- |11.0