public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/49960] New: inconsistant outputs when enabling autopar for a self -dependence testcase
@ 2011-08-03 12:53 razya at gcc dot gnu.org
  2011-08-03 12:54 ` [Bug tree-optimization/49960] " razya at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: razya at gcc dot gnu.org @ 2011-08-03 12:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49960

           Summary: inconsistant outputs when enabling autopar for a self
                    -dependence testcase
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: razya@gcc.gnu.org
                CC: rakdver@kam.mff.cuni.cz, sebpop@gmail.com
              Host: Linux power7/Linux x86
            Target: Linux power7/Linux x86
             Build: Linux power7/Linux x86


Compiling with :
/gcc -O3 -ftree-parallelize-loops=8 -fdump-tree-parloops-details
parallelization-2.c -fno-tree-vectorize

The runs do not always generate the same output:
For example:

> ./a.out 
tmps[1]=1044481
tmps[2]=1044482
tmps[3]=1044483
tmps[4]=1044484
tmps[5]=1044485
tmps[6]=1044486
tmps[7]=1044487
> ./a.out 
tmps[1]=786433
tmps[2]=786434
tmps[3]=786435
tmps[4]=786436
tmps[5]=786437
tmps[6]=786438
tmps[7]=786439


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/49960] inconsistant outputs when enabling autopar for a self -dependence testcase
  2011-08-03 12:53 [Bug tree-optimization/49960] New: inconsistant outputs when enabling autopar for a self -dependence testcase razya at gcc dot gnu.org
@ 2011-08-03 12:54 ` razya at gcc dot gnu.org
  2011-09-01  9:58 ` razya at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: razya at gcc dot gnu.org @ 2011-08-03 12:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49960

--- Comment #1 from razya at gcc dot gnu.org 2011-08-03 12:54:02 UTC ---
Created attachment 24901
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24901
self dependence testcase


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/49960] inconsistant outputs when enabling autopar for a self -dependence testcase
  2011-08-03 12:53 [Bug tree-optimization/49960] New: inconsistant outputs when enabling autopar for a self -dependence testcase razya at gcc dot gnu.org
  2011-08-03 12:54 ` [Bug tree-optimization/49960] " razya at gcc dot gnu.org
@ 2011-09-01  9:58 ` razya at gcc dot gnu.org
  2011-11-16 15:02 ` [Bug tree-optimization/49960] inconsistent " razya at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: razya at gcc dot gnu.org @ 2011-09-01  9:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49960

--- Comment #2 from razya at gcc dot gnu.org 2011-09-01 09:57:21 UTC ---
(In reply to comment #1)
> Created attachment 24901 [details]
> self dependence testcase

Another testcase failing due to a slightly different problem with the self data
dependence analysis:

#include <stdio.h>
#define MB 100
#define NA 70
#define MA 80

int T[MB][MA],A[MA][NA],B[MB][NA];
void MRTRBR(int MA_1, int NA_1, int MB_1)
{
   int i,j, t,k;

   for (k = 3; k < NA_1; k++)
     for (i= 3; i < MA_1; i++)
       for (j = 3; j < MB_1; j++)
         {
            t = T[i][j];
            T[i][j] = t+2+A[i][k]*B[j][k];
         }
}
void main ()
{
 int j,i;

  for (i= 3; i < MA; i++)
    for (j = 3; j < MB; j++)
       T[i][j] = (i>j?i:j);

  MRTRBR (MA,NA,MB);

  for (i= MA-1; i < MA; i++)
    for (j = MB-10; j < MB; j++)
      printf ("i %d j %d T[i][j] = %d\n",i,j,T[i][j]);
}

autopar parallelizes the k loop (I reduced the threshold of # of iterations to
enable parallelization of the outer loop), because
the data dependence analysis claims that the dependence between  
the writes to T[i][j] is (0,0,0).

This causes inconsistent runs:

> ./a.out 
i 79 j 90 T[i][j] = 216
i 79 j 91 T[i][j] = 217
i 79 j 92 T[i][j] = 220
i 79 j 93 T[i][j] = 219
i 79 j 94 T[i][j] = 222
i 79 j 95 T[i][j] = 221
i 79 j 96 T[i][j] = 222
i 79 j 97 T[i][j] = 223
i 79 j 98 T[i][j] = 224
i 79 j 99 T[i][j] = 225
> ./a.out 
i 79 j 90 T[i][j] = 224
i 79 j 91 T[i][j] = 225
i 79 j 92 T[i][j] = 226
i 79 j 93 T[i][j] = 227
i 79 j 94 T[i][j] = 228
i 79 j 95 T[i][j] = 229
i 79 j 96 T[i][j] = 230
i 79 j 97 T[i][j] = 231
i 79 j 98 T[i][j] = 232
i 79 j 99 T[i][j] = 233


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/49960] inconsistent outputs when enabling autopar for a self -dependence testcase
  2011-08-03 12:53 [Bug tree-optimization/49960] New: inconsistant outputs when enabling autopar for a self -dependence testcase razya at gcc dot gnu.org
  2011-08-03 12:54 ` [Bug tree-optimization/49960] " razya at gcc dot gnu.org
  2011-09-01  9:58 ` razya at gcc dot gnu.org
@ 2011-11-16 15:02 ` razya at gcc dot gnu.org
  2011-11-16 15:14 ` razya at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: razya at gcc dot gnu.org @ 2011-11-16 15:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49960

--- Comment #3 from razya at gcc dot gnu.org 2011-11-16 14:58:10 UTC ---
Author: razya
Date: Wed Nov 16 14:58:04 2011
New Revision: 181409

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181409
Log:
    PR tree-optimization/49960

    * gcc.dg/autopar/pr49960.c: New test.
    * gcc.dg/autopar/pr49960-1.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/autopar/pr49960-1.c
    trunk/gcc/testsuite/gcc.dg/autopar/pr49960.c


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/49960] inconsistent outputs when enabling autopar for a self -dependence testcase
  2011-08-03 12:53 [Bug tree-optimization/49960] New: inconsistant outputs when enabling autopar for a self -dependence testcase razya at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-11-16 15:02 ` [Bug tree-optimization/49960] inconsistent " razya at gcc dot gnu.org
@ 2011-11-16 15:14 ` razya at gcc dot gnu.org
  2011-11-16 15:18 ` razya at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: razya at gcc dot gnu.org @ 2011-11-16 15:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49960

--- Comment #4 from razya at gcc dot gnu.org 2011-11-16 14:59:18 UTC ---
Author: razya
Date: Wed Nov 16 14:59:14 2011
New Revision: 181410

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181410
Log:
    PR tree-optimization/49960

    * gcc.dg/autopar/pr49960.c: New test.
    * gcc.dg/autopar/pr49960-1.c: New test.

Modified:
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/49960] inconsistent outputs when enabling autopar for a self -dependence testcase
  2011-08-03 12:53 [Bug tree-optimization/49960] New: inconsistant outputs when enabling autopar for a self -dependence testcase razya at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-11-16 15:14 ` razya at gcc dot gnu.org
@ 2011-11-16 15:18 ` razya at gcc dot gnu.org
  2015-07-12 22:28 ` vries at gcc dot gnu.org
  2015-07-12 22:29 ` vries at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: razya at gcc dot gnu.org @ 2011-11-16 15:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49960

--- Comment #5 from razya at gcc dot gnu.org 2011-11-16 15:01:52 UTC ---
Author: razya
Date: Wed Nov 16 15:01:47 2011
New Revision: 181411

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181411
Log:
    PR tree-optimization/49960

    * tree-data-ref.c (initialize_data_dependence_relation): Add
initializations. 
    Remove call to compute_self_dependence.
    (compute_affine_dependence): Remove the !DDR_SELF_REFERENCE condition.
    (compute_self_dependence): Remove old code. Add call to
compute_affine_dependence.
    (compute_all_dependences): Remove call to compute_self_dependence. 
    Add call to compute_affine_dependence.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-data-ref.c


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/49960] inconsistent outputs when enabling autopar for a self -dependence testcase
  2011-08-03 12:53 [Bug tree-optimization/49960] New: inconsistant outputs when enabling autopar for a self -dependence testcase razya at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-11-16 15:18 ` razya at gcc dot gnu.org
@ 2015-07-12 22:28 ` vries at gcc dot gnu.org
  2015-07-12 22:29 ` vries at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2015-07-12 22:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49960

vries at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #6 from vries at gcc dot gnu.org ---
Given this discussion (
https://gcc.gnu.org/ml/gcc-patches/2011-11/msg02081.html ) this follow-up patch
was committed.

https://gcc.gnu.org/ml/gcc-cvs/2011-11/msg00985.html

Author: razya
Date: Thu Nov 24 14:07:36 2011
New Revision: 181691

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181691
Log:

        * tree-data-ref.c (initialize_data_dependence_relation): Update
        * comment for the 
        self dependence case.
        (compute_self_dependence): Remove.
        * tree-vect-data-refs.c (vect_analyze_data_refs): Remove call to 
        compute_self_dependenc. 

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-data-ref.c
    trunk/gcc/tree-vect-data-refs.c


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/49960] inconsistent outputs when enabling autopar for a self -dependence testcase
  2011-08-03 12:53 [Bug tree-optimization/49960] New: inconsistant outputs when enabling autopar for a self -dependence testcase razya at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2015-07-12 22:28 ` vries at gcc dot gnu.org
@ 2015-07-12 22:29 ` vries at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2015-07-12 22:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49960

vries at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from vries at gcc dot gnu.org ---
patch and test-case committed long ago, resolving marked-fixed.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-12 22:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-03 12:53 [Bug tree-optimization/49960] New: inconsistant outputs when enabling autopar for a self -dependence testcase razya at gcc dot gnu.org
2011-08-03 12:54 ` [Bug tree-optimization/49960] " razya at gcc dot gnu.org
2011-09-01  9:58 ` razya at gcc dot gnu.org
2011-11-16 15:02 ` [Bug tree-optimization/49960] inconsistent " razya at gcc dot gnu.org
2011-11-16 15:14 ` razya at gcc dot gnu.org
2011-11-16 15:18 ` razya at gcc dot gnu.org
2015-07-12 22:28 ` vries at gcc dot gnu.org
2015-07-12 22:29 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).