<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:andrey.churbanov@intel.com" title="Andrey Churbanov <andrey.churbanov@intel.com>"> <span class="fn">Andrey Churbanov</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - omp_sched_monotonic declaration causes error when building the compiler"
   href="https://bugs.llvm.org/show_bug.cgi?id=41755">bug 41755</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>kli@ca.ibm.com
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - omp_sched_monotonic declaration causes error when building the compiler"
   href="https://bugs.llvm.org/show_bug.cgi?id=41755#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - omp_sched_monotonic declaration causes error when building the compiler"
   href="https://bugs.llvm.org/show_bug.cgi?id=41755">bug 41755</a>
              from <span class="vcard"><a class="email" href="mailto:andrey.churbanov@intel.com" title="Andrey Churbanov <andrey.churbanov@intel.com>"> <span class="fn">Andrey Churbanov</span></a>
</span></b>
        <pre>I added Kelvin to CC list just in case, as a Fortran expert.

I am sorry, I could be too rigorous in my initial comment without 
enough details, as I referred to the Fortran 2008 standard 
(<a href="ftp://ftp.nag.co.uk/sc22wg5/N1801-N1850/N1830.pdf">ftp://ftp.nag.co.uk/sc22wg5/N1801-N1850/N1830.pdf</a>).
Indeed, for the F03, things are not so clear, because it only states 
that the boz-literal-constant should behave in our case (given that 
we've fixed non-standard assignment) as 
INT(INT(0x80000000, kind=16), kind=4), 
and I failed to find what should happen during conversion of 
128-bit value into 32-bit value in the F03 standard.

<span class="quote">> 2. 0x80000000 = 2,147,483,648. This cannot be represented by a signed 4-byte integer; it requires an unsigned 4-byte integer.</span >
That sounds a bit ambiguous to me. I'd say that definitely
0x80000000 = 2147483648_16
given gfortran supports 128-byte integers. And then
2147483648_16 = -2147483648_4.
Which is perfectly valid 32-bit integer. And that is what gfortran does with
-fno-range-check flag. I agree that possibly gfortran has the right to treat
the integer conversion the way it does (C-style, as opposed to Fortran bit
model), and complain on integer overflow. But the F03 does not require it to
behave this way, as there are no details on what the integer conversion should
do. According to bit model (section 13.3. of F03) our code looks fine.

And I don't think we should treat F08 to be in contradiction with F03 here. I'd
rather treat F08 as a clarification of F03, in which case again gfortan behaves
wrong by default.

<span class="quote">> c). Finally, even if the code is changed to be standard-conforming, its extensive use of digit-strings as kind type parameters makes it non-portable...</span >
We try to not use digit strings as kinds, so the code still looks pretty
portable (we use c_int and propagate it to all integer kinds of default size).
If some implementation only supports 16-bit integers, than that can be a
problem.  But as Johnny noted, here we follow OpenMP specification which
hardcoded the value in the text.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>