* [Bug tree-optimization/58453] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
@ 2013-09-18 0:53 ` pthaugen at gcc dot gnu.org
2013-09-18 0:56 ` pthaugen at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pthaugen at gcc dot gnu.org @ 2013-09-18 0:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
--- Comment #1 from Pat Haugen <pthaugen at gcc dot gnu.org> ---
Created attachment 30841
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30841&action=edit
Source file
pdv.f source file from benchmark, which results in successful execution if
compiled with prior revision (r202429).
Should have noted in prior comment, compile options used when building the
benchmark are:
-m64 -O3 -mcpu=power7 -fno-tree-loop-distribution -fno-tree-vectorize
(Note that failure still exists for just "-m64 -O3 -mcpu=power7" other 2
options were just included while trying to narrow down dumps/assembler for
debugging.)
Compiling with -fno-tree-loop-distribute-patterns results in benchmark success.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/58453] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
2013-09-18 0:53 ` [Bug tree-optimization/58453] " pthaugen at gcc dot gnu.org
@ 2013-09-18 0:56 ` pthaugen at gcc dot gnu.org
2013-09-18 0:57 ` pthaugen at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pthaugen at gcc dot gnu.org @ 2013-09-18 0:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
--- Comment #2 from Pat Haugen <pthaugen at gcc dot gnu.org> ---
Created attachment 30842
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30842&action=edit
r202429 ldist dump
Loop distribution dump for pdv.f using rev 202429.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/58453] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
2013-09-18 0:53 ` [Bug tree-optimization/58453] " pthaugen at gcc dot gnu.org
2013-09-18 0:56 ` pthaugen at gcc dot gnu.org
@ 2013-09-18 0:57 ` pthaugen at gcc dot gnu.org
2013-09-18 1:44 ` pthaugen at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pthaugen at gcc dot gnu.org @ 2013-09-18 0:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
--- Comment #3 from Pat Haugen <pthaugen at gcc dot gnu.org> ---
Created attachment 30843
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30843&action=edit
r202431 ldist dump
Loop distribution dump for pdv.f using rev 202431.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/58453] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
` (2 preceding siblings ...)
2013-09-18 0:57 ` pthaugen at gcc dot gnu.org
@ 2013-09-18 1:44 ` pthaugen at gcc dot gnu.org
2013-09-18 8:49 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pthaugen at gcc dot gnu.org @ 2013-09-18 1:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
--- Comment #4 from Pat Haugen <pthaugen at gcc dot gnu.org> ---
Just discovered that -fwrapv results in successful execution also, so possibly
bad source.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/58453] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
` (3 preceding siblings ...)
2013-09-18 1:44 ` pthaugen at gcc dot gnu.org
@ 2013-09-18 8:49 ` rguenth at gcc dot gnu.org
2013-09-18 8:50 ` [Bug tree-optimization/58453] [4.9 Regression] " rguenth at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-09-18 8:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ysrumyan at gmail dot com
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
*** Bug 58444 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/58453] [4.9 Regression] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
` (4 preceding siblings ...)
2013-09-18 8:49 ` rguenth at gcc dot gnu.org
@ 2013-09-18 8:50 ` rguenth at gcc dot gnu.org
2013-09-18 11:54 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-09-18 8:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2013-09-18
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
Target Milestone|--- |4.9.0
Summary|Revision 202431 results in |[4.9 Regression] Revision
|miscompare for CPU2006 |202431 results in
|434.zeusmp |miscompare for CPU2006
| |434.zeusmp
Ever confirmed|0 |1
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/58453] [4.9 Regression] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
` (5 preceding siblings ...)
2013-09-18 8:50 ` [Bug tree-optimization/58453] [4.9 Regression] " rguenth at gcc dot gnu.org
@ 2013-09-18 11:54 ` rguenth at gcc dot gnu.org
2013-09-18 12:15 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-09-18 11:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
loop distribution distributes this into
q2 = ( g2a(i+1) * g31a(i+1) * v1(i+1,j,k)
1 - g2a(i ) * g31a(i ) * v1(i ,j,k) )
2 * dvl1ai(i)
3 + ( g32a(j+1) * v2(i,j+1,k)
4 - g32a(j ) * v2(i,j ,k) )
5 * g2bi(i) * dvl2ai(j)
6 + ( v3(i,j,k+1) - v3(i,j,k) )
7 * g31bi(i) * g32bi(j) * dvl3ai(k)
q2 = q2 * q1
e(i,j,k) = ( 1.0 - q2 ) / ( 1.0 + q2 ) * e(i,j,k)
and a memcpy for
dlo(i,j,k) = d(i,j,k)
and
eod(i,j,k) = e(i,j,k) / d(i,j,k)
(re-computing e(i,j,k) instead of loading it from the stored value - a known
deficiency)
This doesn't look wrong on the first glance (but it's probably slower).
What the revision in question changed was remove some very odd code
from rdg_flag_uses:
- if (gimple_code (stmt) != GIMPLE_PHI)
- {
- if ((use_p = gimple_vuse_op (stmt)) != NULL_USE_OPERAND_P)
- {
- tree use = USE_FROM_PTR (use_p);
-
- if (TREE_CODE (use) == SSA_NAME
- && !SSA_NAME_IS_DEFAULT_DEF (use))
- {
- gimple def_stmt = SSA_NAME_DEF_STMT (use);
- int v = rdg_vertex_for_stmt (rdg, def_stmt);
-
- if (v >= 0
- && !already_processed_vertex_p (processed, v))
- rdg_flag_vertex_and_dependent (rdg, v, partition, loops,
- processed);
- }
- }
- }
that just doesn't make sense, but it likely made sure everything ended up
in a single partition.
Does the benchmark fail if you build with -ftree-loop-distribution
-fno-tree-loop-distribute-patterns? (it should emit a loop instead of the
memcpy call)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/58453] [4.9 Regression] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
` (6 preceding siblings ...)
2013-09-18 11:54 ` rguenth at gcc dot gnu.org
@ 2013-09-18 12:15 ` rguenth at gcc dot gnu.org
2013-09-18 12:57 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-09-18 12:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #7)
> Does the benchmark fail if you build with -ftree-loop-distribution
> -fno-tree-loop-distribute-patterns? (it should emit a loop instead of the
> memcpy call)
of course not - we fuse the partitions because of the similar memory accesses
again.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/58453] [4.9 Regression] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
` (7 preceding siblings ...)
2013-09-18 12:15 ` rguenth at gcc dot gnu.org
@ 2013-09-18 12:57 ` rguenth at gcc dot gnu.org
2013-09-20 12:17 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-09-18 12:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ah, so we have
_103 = fieldr.e[_51];
_104 = _102 * _103;
fieldr.e[_51] = _104;
_106 = fieldr.d[_51];
*dlo_107(D)[_51] = _106;
_109 = _104 / _106;
*eod_110(D)[_51] = _109;
and distribute it as
_103 = fieldr.e[_51];
_104 = _102 * _103;
fieldr.e[_51] = _104;
memcpy (dlo, &fieldr.d, ...)
_103 = fieldr.e[_51];
_104 = _102 * _103;
_106 = fieldr.d[_51];
_109 = _104 / _106;
*eod_110(D)[_51] = _109;
but that's obviously wrong as we are re-loading a different fieldr.e.
Testcase:
extern void abort (void);
int a[128], b[128], c[128], d[128];
void __attribute__((noinline,noclone))
foo (void)
{
int i;
for (i = 0; i < 128; ++i)
{
a[i] = a[i] + 1;
b[i] = d[i];
c[i] = a[i] / d[i];
}
}
int main()
{
int i;
for (i = 0; i < 128; ++i)
a[i] = i;
for (i = 0; i < 128; ++i)
d[i] = 1;
foo ();
if (c[0] != 1)
abort ();
return 0;
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/58453] [4.9 Regression] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
` (8 preceding siblings ...)
2013-09-18 12:57 ` rguenth at gcc dot gnu.org
@ 2013-09-20 12:17 ` rguenth at gcc dot gnu.org
2013-09-20 12:21 ` rguenth at gcc dot gnu.org
2013-09-20 12:21 ` rguenth at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-09-20 12:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
With -ftree-loop-distribution we fuse the first and the last partition
resulting in correct code again. We're really missing partition dependencies -
see PR53616.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/58453] [4.9 Regression] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
` (9 preceding siblings ...)
2013-09-20 12:17 ` rguenth at gcc dot gnu.org
@ 2013-09-20 12:21 ` rguenth at gcc dot gnu.org
2013-09-20 12:21 ` rguenth at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-09-20 12:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Fri Sep 20 12:21:08 2013
New Revision: 202775
URL: http://gcc.gnu.org/viewcvs?rev=202775&root=gcc&view=rev
Log:
2013-09-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/58453
* tree-loop-distribution.c (distribute_loop): Apply the cost
model for -ftree-loop-distribute-patterns, too.
* gcc.dg/tree-ssa/ldist-23.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/ldist-23.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-loop-distribution.c
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/58453] [4.9 Regression] Revision 202431 results in miscompare for CPU2006 434.zeusmp
2013-09-18 0:48 [Bug tree-optimization/58453] New: Revision 202431 results in miscompare for CPU2006 434.zeusmp pthaugen at gcc dot gnu.org
` (10 preceding siblings ...)
2013-09-20 12:21 ` rguenth at gcc dot gnu.org
@ 2013-09-20 12:21 ` rguenth at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-09-20 12:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58453
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 13+ messages in thread