fix invalid bounds on array refs
authorAditya Kumar <aditya.k7@samsung.com>
Wed, 2 Dec 2015 17:11:52 +0000 (17:11 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Wed, 2 Dec 2015 17:11:52 +0000 (17:11 +0000)
commit2e733703c0328d10098ced65abcc9803b4e5616d
tree1e81e6d67ce52610d9ca4e70944d0e99453388dd
parent84c36240fc2df7a749772bb02df8632c5d5acec6
fix invalid bounds on array refs

While enabling graphite in -O3 we found a Fortran testcase that fails
because the max of the type domain is -1.  We used to add that as a constraint
to the elements accessed by the array, leading to a unfeasible constraint:
0 <= i <= -1.  Having that constraint, drops the data reference as that says
that there are no elements accessed in the array.

* graphite-dependences.c (scop_get_reads): Add extra dumps.
(scop_get_must_writes): Same.
(scop_get_may_writes): Same.
(compute_deps): Same.
* graphite-sese-to-poly.c (bounds_are_valid): New.
(pdr_add_data_dimensions): Call bounds_are_valid.

* gfortran.dg/graphite/run-id-3.f90: New.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r231191
gcc/ChangeLog
gcc/graphite-dependences.c
gcc/graphite-sese-to-poly.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/graphite/run-id-3.f90 [new file with mode: 0644]