This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/39500] autopar fails to parallel



------- Comment #1 from nemokingdom at gmail dot com  2009-03-19 01:27 -------
(In reply to comment #0)
> autopar fails auto-parallelization with the code below:
> 
> int X[1000];
> 
> int main(void)
> {
>   int i;
> 
>   for (i = 0; i < 100; i++)
>       X[i] = X[i+100];
> 
>   return 0;
> }
> 
This bug basically about x1 and y1 not allowed to be in between zero and niter
- 1. This seems to be an typical off by one error.

x1 and y1 not allowed to be in between zero and niter - 1. This seems to
be an typical off by one error.

Index: tree-data-ref.c
===================================================================
--- tree-data-ref.c     (revision 144721)
+++ tree-data-ref.c     (working copy)
@@ -2292,7 +2292,7 @@

                  /* If the overlap occurs outside of the bounds of the
                     loop, there is no dependence.  */
-                 if (x1 > niter || y1 > niter)
+                 if (x1 >= niter || y1 >= niter)
                    {
                      *overlaps_a = conflict_fn_no_dependence ();
                      *overlaps_b = conflict_fn_no_dependence ();


-- 

nemokingdom at gmail dot com changed:

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]