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

            Bug ID: 65819
           Summary: overzealous checking in gfc_check_dependency for
                    identical=true
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org

Just ran across this while trying to cook up a test case for matrix inlining.

In the patch proposed for PR 37131, I have

  if (gfc_check_dependency (expr1, matrix_a, true)
      || gfc_check_dependency (expr1, matrix_b, true))
    return 0;

In the test case, I want to do

  f(3,1:eight:2,:) = matmul(f(1,1:3,2:3), f(2,2:3,:))

where clearly the lhs does not depend on the rhs.  However, specifying true to
gfc_dep_dependency leads to

      if (identical)
    return 1;

before any checking is done.  I'm not sure if there is a real-world test
case yet, but there will be one soon, so I'll keep this PR as a reminder.

Reply via email to