<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/61609>61609</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang] Copy-pasted code. Seems one of them is wrong. May be the second should be x.upper(), y.upper()?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ustchcs-bugfinder
      </td>
    </tr>
</table>

<pre>
    https://github.com/llvm/llvm-project/blob/08d094a0e457360ad8b94b017d2dc277e697ca76/flang/lib/Lower/IterationSpace.cpp#L451

Current code:
```
static bool isEqual(const Fortran::evaluate::Substring &x,
                      const Fortran::evaluate::Substring &y) {
 return std::visit(
               [&](const auto &p, const auto &q) { return isEqual(p, q); },
               x.parent(), y.parent()) &&
 isEqual(x.lower(), y.lower()) && isEqual(x.lower(), y.lower()); // ----> Same condition. May be the second should be x.upper()?
  }
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVM1u8yoQfRq8QbEItsEsvGiTWrpS7ypPAGbicEWMy0-bvP0VdtMon_otYiFbDJwznGGOZQhmnAA61LyiZl_IFE_OdynE4TSEjUrj0UwafKGcvnanGOeAqhdEe0T70cRTUuXgzoj21n7ePpvZu_9giIj2yjqFaE9aTUQtCdQNrxiRulWiVmTLNdUD5RyY4IPkDNH-aOU0ZiKTge_uCzyi_T8RvIzGTYdZDlAO84xo9V43W0T2iLys713yHqaIB6chH3JdYuR7LNMQZTQDVs5ZbMLbR5IW0XZwU4i4dz56OWVo9QKf0iYZYZ0dkgrRm2nEiLILoruVDf_6PMd2RVRgxF-_GT3E5Cccol73fppgIqLtrwnzpVGGmv2PBpmiy6wzojv8GPr4TnRLcZe_bM7LqHrFiO__pu9SzjJXOB-Higy6_hEROVEeK_ye4lLa9SrvyIfADfgMZDnt0ol4s9lsUPWGD_IMWbY2uVlK_K-8YgU4ngAHyHEcTi5ZnYOXMs3zD13V3yTnAjy2TqG7SotKyAK6LeOiZk3V8uLU1ZJtOYda1wNlkiveatrWgjOlRVXLtjAdJbQiFaWEEVHz8qhbwZta81YJ0CBRTeAsjS2zcUrnx8KEkKBjW0ZEYaUCG27e9N3iLpXGgGpiTYjhDosm2sXFq4GaPd65-bqZZYigF0uU-ABwDthNgN0x1-SMTcBf3k3jM5VabuKxdEXy9vmfw6I0INovYv8PAAD__6DbVdA">