From patchwork Mon Aug 2 19:17:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [fortran] PR 45159, dependency checking Date: Mon, 02 Aug 2010 09:17:45 -0000 From: Thomas Koenig X-Patchwork-Id: 60564 Message-Id: <1280776665.8778.7.camel@linux-fd1f.site> To: fortran@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org Hello world, this rather simple patch fixes one test case from PR 45159 (many more to go). This one is rather important because this is a real-world hot loop. Regression-tested. OK for trunk? (BTW, did the loop reversal stuff get committed to 4.5 as well? If this is the case, I would also want to fix this there). Thomas 2010-08-02 Thomas Koenig PR fortran/45159 * depencency.c (gfc_dep_resolver): Fix logic for when a loop can be reversed. 2010-08-02 Thomas Koenig PR fortran/45159 * gfortran.dg/dependency_29.f90: New test. Index: dependency.c =================================================================== --- dependency.c (Revision 162824) +++ dependency.c (Arbeitskopie) @@ -1716,8 +1716,8 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gf /* If no intention of reversing or reversing is explicitly inhibited, convert backward dependence to overlap. */ - if ((reverse == NULL && this_dep == GFC_DEP_BACKWARD) - || (reverse && reverse[n] == GFC_CANNOT_REVERSE)) + if (this_dep == GFC_DEP_BACKWARD + && (reverse == NULL || reverse[n] == GFC_CANNOT_REVERSE)) this_dep = GFC_DEP_OVERLAP; }