* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
@ 2015-04-30 4:29 ` hjl.tools at gmail dot com
2015-04-30 7:31 ` jakub at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hjl.tools at gmail dot com @ 2015-04-30 4:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-04-30
Target Milestone|--- |6.0
Ever confirmed|0 |1
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
gcc -m32 -O3 -funroll-loops -msse2 -mfpmath=sse -ffast-math also miscompiled.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
2015-04-30 4:29 ` [Bug tree-optimization/65935] " hjl.tools at gmail dot com
@ 2015-04-30 7:31 ` jakub at gcc dot gnu.org
2015-04-30 7:40 ` rguenth at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-30 7:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
What exact revision do you mean? r62283 is quite a bit old...
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
2015-04-30 4:29 ` [Bug tree-optimization/65935] " hjl.tools at gmail dot com
2015-04-30 7:31 ` jakub at gcc dot gnu.org
@ 2015-04-30 7:40 ` rguenth at gcc dot gnu.org
2015-04-30 12:08 ` hjl.tools at gmail dot com
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-04-30 7:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
I suppose r222514.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
` (2 preceding siblings ...)
2015-04-30 7:40 ` rguenth at gcc dot gnu.org
@ 2015-04-30 12:08 ` hjl.tools at gmail dot com
2015-04-30 12:34 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hjl.tools at gmail dot com @ 2015-04-30 12:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Richard Biener from comment #3)
> I suppose r222514.
Yes, it is.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
` (3 preceding siblings ...)
2015-04-30 12:08 ` hjl.tools at gmail dot com
@ 2015-04-30 12:34 ` rguenth at gcc dot gnu.org
2015-04-30 12:39 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-04-30 12:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Also reproduces with -Ofast -march=bdver2 -m32 so I suppose -O3 -ffast-math
-m32 -msse2 should also reproduce it.
I wont get to look into this before Monday, any help in bisecting
(-fno-tree-vectorize for which file(s) fix it? for which function?)
appreciated
until then.
At least milc is C and not too big ;)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
` (4 preceding siblings ...)
2015-04-30 12:34 ` rguenth at gcc dot gnu.org
@ 2015-04-30 12:39 ` rguenth at gcc dot gnu.org
2015-04-30 14:48 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-04-30 12:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
` (5 preceding siblings ...)
2015-04-30 12:39 ` rguenth at gcc dot gnu.org
@ 2015-04-30 14:48 ` rguenth at gcc dot gnu.org
2015-04-30 15:28 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-04-30 14:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Also fails with the test input.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
` (6 preceding siblings ...)
2015-04-30 14:48 ` rguenth at gcc dot gnu.org
@ 2015-04-30 15:28 ` rguenth at gcc dot gnu.org
2015-05-04 9:24 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-04-30 15:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Building rephase.c:rephase with -fno-tree-slp-vectorize makes it succeed.
The loop is basically
register int i,j,k,dir;
register site *s;
for(i=0,s=lattice;i<sites_on_node;i++,s++){
for(dir=0;dir<=3;dir++){
for(j=0;j<3;j++)for(k=0;k<3;k++){
s->link[dir].e[j][k].real *= s->phase[dir];
s->link[dir].e[j][k].imag *= s->phase[dir];
}
}
}
where the inner two loops are unrolled and SLP applies to them. We need to
perform swapping on some of the mult operands and then somehow fail to use
the correct vectors to build up s->phase[dir] from parts.
vect_cst_.35_44 = {_117, _121};
vect_cst_.36_45 = {_110, _114};
vect_cst_.37_46 = {_103, _107};
vect_cst_.38_47 = {_92, _96};
vect_cst_.39_48 = {_85, _89};
vect_cst_.40_52 = {_78, _82};
vect_cst_.41_53 = {_49, _71};
vect_cst_.42_54 = {_31, _60};
vect_cst_.43_55 = {_24, _27};
note how these should be all {_24, _24} but only the first one is correct.
I think this is a latent issue since we do the swapping tricks.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
` (7 preceding siblings ...)
2015-04-30 15:28 ` rguenth at gcc dot gnu.org
@ 2015-05-04 9:24 ` rguenth at gcc dot gnu.org
2015-05-04 10:03 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-05-04 9:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Testcase that also fails with -m64.
/* { dg-do run } */
/* { dg-additional-options "-O3" } */
/* { dg-require-effective-target vect_double } */
#include "tree-vect.h"
extern void abort (void);
extern void *malloc (__SIZE_TYPE__);
struct site {
struct {
struct {
double real;
double imag;
} e[3][3];
} link[32];
double phase[32];
} *lattice;
int sites_on_node;
void rephase (void)
{
int i,j,k,dir;
struct site *s;
for(i=0,s=lattice;i<sites_on_node;i++,s++)
for(dir=0;dir<32;dir++)
for(j=0;j<3;j++)for(k=0;k<3;k++)
{
s->link[dir].e[j][k].real *= s->phase[dir];
s->link[dir].e[j][k].imag *= s->phase[dir];
}
}
int main()
{
int i,j,k;
check_vect ();
sites_on_node = 1;
lattice = malloc (sizeof (struct site) * sites_on_node);
for (i = 0; i < 32; ++i)
{
lattice->phase[i] = i;
for (j = 0; j < 3; ++j)
for (k = 0; k < 3; ++k)
{
lattice->link[i].e[j][k].real = 1.0;
lattice->link[i].e[j][k].imag = 1.0;
__asm__ volatile ("" : : : "memory");
}
}
rephase ();
for (i = 0; i < 32; ++i)
for (j = 0; j < 3; ++j)
for (k = 0; k < 3; ++k)
if (lattice->link[i].e[j][k].real != i
|| lattice->link[i].e[j][k].imag != i)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "slp1" } } */
/* { dg-final { cleanup-tree-dump "slp1" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
` (8 preceding siblings ...)
2015-05-04 9:24 ` rguenth at gcc dot gnu.org
@ 2015-05-04 10:03 ` rguenth at gcc dot gnu.org
2015-05-04 13:31 ` rguenth at gcc dot gnu.org
2015-05-04 13:31 ` rguenth at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-05-04 10:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Testing a fix. The issue is latent with at least constant operands - but it's
probably impossible(?) to get bogus operand order on those. In theory if the
loads from phase were just in a different BB the issue would reproduce as well.
OTOH then GCC 5 swaps in vect_get_and_check_slp_defs which already does swap
operands in the IL...
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
` (9 preceding siblings ...)
2015-05-04 10:03 ` rguenth at gcc dot gnu.org
@ 2015-05-04 13:31 ` rguenth at gcc dot gnu.org
2015-05-04 13:31 ` rguenth at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-05-04 13:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/65935] [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled
2015-04-30 2:25 [Bug tree-optimization/65935] New: [6 Regression] 433.milc in SPEC CPU 2006 is miscompiled hjl.tools at gmail dot com
` (10 preceding siblings ...)
2015-05-04 13:31 ` rguenth at gcc dot gnu.org
@ 2015-05-04 13:31 ` rguenth at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-05-04 13:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65935
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Mon May 4 13:31:02 2015
New Revision: 222764
URL: https://gcc.gnu.org/viewcvs?rev=222764&root=gcc&view=rev
Log:
2015-05-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/65935
* tree-vect-slp.c (vect_build_slp_tree): If we swapped operands
then make sure to apply that swapping to the IL.
* gcc.dg/vect/bb-slp-pr65935.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.dg/vect/bb-slp-pr65935.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vect-slp.c
^ permalink raw reply [flat|nested] 13+ messages in thread