<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic BUG in EOSHIFT function in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754196#M9716</link>
    <description>Here is a workaround: add an array containing zeros, of the correct shape and type, to the expression on the right.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fortran]program test_intel_visual_fortran
integer(4) :: a(0:7)=(/0,1,2,3,4,5,6,7/)**2, ii(4)=0
integer(4) :: ar(0:7) = 0

ar(2:7-2) = eoshift(a(2:7-2),shift=1) + ii
print*, "a ", a(2:7-2)
print*, "ar", ar(2:7-2)

end program test_intel_visual_fortran
[/fortran]&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 Apr 2011 00:08:37 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2011-04-06T00:08:37Z</dc:date>
    <item>
      <title>BUG in EOSHIFT function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754193#M9713</link>
      <description>&lt;P&gt;The following code shifts a portion of an integer array one position and assigns it to a portion of another array (I have not tried to simplify it further):&lt;/P&gt;&lt;P&gt;program test_intel_visual_fortran&lt;/P&gt;&lt;P&gt;integer(4) :: a(0:7)=(/0,1,2,3,4,5,6,7/)**2&lt;/P&gt;&lt;P&gt;integer(4) :: ar(0:7) = 0 &lt;/P&gt;&lt;P&gt;ar(2:7-2) = eoshift(a(2:7-2),shift=1)&lt;/P&gt;&lt;P&gt;print*, "a ", a(2:7-2)&lt;/P&gt;&lt;P&gt;print*, "ar", ar(2:7-2) &lt;/P&gt;&lt;P&gt;end program test_intel_visual_fortran&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;When compiled and run on the LINUX with the latest available ifort v 12.x.x. compiler&lt;/P&gt;&lt;P&gt;#ifort -V&lt;/P&gt;&lt;P&gt;Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.0.084 Build 20101006&lt;/P&gt;&lt;P&gt;Copyright (C) 1985-2010 Intel Corporation. All rights reserved.&lt;/P&gt;&lt;P&gt;as well as with the (about 1.5 years old) ifort v 11.1.059&lt;/P&gt;&lt;P&gt;#ifort -O0 test_intel_visual_fortran.f90&lt;/P&gt;&lt;P&gt;#a.out&lt;/P&gt;&lt;P&gt;it produces an INCORRECT result:&lt;/P&gt;&lt;P&gt;a 4 9 16 25&lt;/P&gt;&lt;P&gt;ar25 0 0 0&lt;/P&gt;&lt;P&gt;Gfortran, Intel Linux ifort v 10.1.015, v 9.1.045, and Window Intel Visual Fortran 11.x.x&lt;/P&gt;&lt;P&gt;all produce the CORRECT ouput:&lt;/P&gt;&lt;P&gt;#ifort -V&lt;/P&gt;&lt;P&gt;Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20080312 Package ID: l_fc_p_10.1.015&lt;/P&gt;&lt;P&gt;Copyright (C) 1985-2008 Intel Corporation. All rights reserved.&lt;/P&gt;&lt;P&gt;#ifort -O0 test_intel_visual_fortran.f90 &lt;/P&gt;&lt;P&gt;#a.out&lt;/P&gt;&lt;P&gt;a 4 9 16 25&lt;/P&gt;&lt;P&gt;ar 9 16 25 0&lt;/P&gt;&lt;P&gt;The 11.1.x and 12.x.x.x produce incorrect values for real(4)'s and integer(8)'s sometimes misshifting the array &lt;/P&gt;&lt;P&gt;by 1 and sometimes by 2 extra elements.&lt;/P&gt;&lt;P&gt;Please confirm and, if true, that is really disturbing how that could have happened in the first place and&lt;/P&gt;&lt;P&gt;may indicate a systemic problem with the intel compiler quality assurance process, that it let through&lt;/P&gt;&lt;P&gt;a BUG in an intrinsic functon and have not intercepted it since at least june 2009!&lt;/P&gt;&lt;P&gt;It is indeed hard to belive.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2011 18:25:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754193#M9713</guid>
      <dc:creator>Alex_S_5</dc:creator>
      <dc:date>2011-04-05T18:25:16Z</dc:date>
    </item>
    <item>
      <title>BUG in EOSHIFT function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754194#M9714</link>
      <description>Thanks for your inquiry.&lt;BR /&gt;&lt;BR /&gt;Your test program doesn't really demonstrate what you claim - that there is a bug in EOSHIFT. What I find, when I enhance the program, is that EOSHIFT is returning the correct results in version 12, but the assignment of the result to an array slice ignores the specified lower bound for the destination. So instead of assigning to elements 2:5, it assigns to 0:3. This is not a general problem, as if you assign another array of the correct shape to such a slice it works. I don't yet know if this issue is limited to EOSHIFT or if it is generic to functions returning array results.&lt;BR /&gt;&lt;BR /&gt;In any case, it is an unusual combination of things that leads to the incorrect results, which helps explain why we did not find it earlier (nor had it been reported to us earlier.) I have escalated this as issue DPD200168025 and will update this thread as we make progress on it. Thanks for bringing it to our attention.&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Apr 2011 21:19:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754194#M9714</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-04-05T21:19:09Z</dc:date>
    </item>
    <item>
      <title>BUG in EOSHIFT function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754195#M9715</link>
      <description>Thanks for the prompt reply, Steve.&lt;BR /&gt;&lt;BR /&gt;CSHIFT workedfine soIassociated thebugwith the EOSHIFTfunction&lt;BR /&gt;&lt;BR /&gt;Idisagree withyour statement that thecombination is "unusual", as&lt;BR /&gt;the intrinsic array-routines and array slicesare used just everywhere in fortran 90/95.&lt;BR /&gt;And I do not see a plausible explanation as to why this bug had not beendiscovered &lt;BR /&gt;in almost 2 years. Maybe, everybody who runs theintel compiler on linux clusters &lt;BR /&gt;has been (like us) putting off upgrading to newer versions, or is using mostly f77 style programming, etc.&lt;BR /&gt;&lt;BR /&gt;On the other note, Iremembera somewhatsimilar problem of passing array slices as arguments with an&lt;BR /&gt;intel fortran on Itanium about 5 yearsagoor so. That time Ithought, it was because the platform was &lt;BR /&gt;relatively new and not allbugs had been worked out (the bug was fixed in a matter of days).&lt;BR /&gt;So, it would really be nice if the above code (or a similar one) becomes a&lt;BR /&gt;part ofthe intel fortran release"quality assurance suite" (you guys do&lt;BR /&gt;have anelaboratedquality assurance procedure with gazillion of test routins, don't you?)&lt;BR /&gt;which would guarranty that at least this exact bug will NEVER appear inANY of the next releases.&lt;BR /&gt;&lt;BR /&gt;Alex&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Apr 2011 23:52:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754195#M9715</guid>
      <dc:creator>Alex_S_5</dc:creator>
      <dc:date>2011-04-05T23:52:47Z</dc:date>
    </item>
    <item>
      <title>BUG in EOSHIFT function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754196#M9716</link>
      <description>Here is a workaround: add an array containing zeros, of the correct shape and type, to the expression on the right.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fortran]program test_intel_visual_fortran
integer(4) :: a(0:7)=(/0,1,2,3,4,5,6,7/)**2, ii(4)=0
integer(4) :: ar(0:7) = 0

ar(2:7-2) = eoshift(a(2:7-2),shift=1) + ii
print*, "a ", a(2:7-2)
print*, "ar", ar(2:7-2)

end program test_intel_visual_fortran
[/fortran]&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Apr 2011 00:08:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754196#M9716</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-04-06T00:08:37Z</dc:date>
    </item>
    <item>
      <title>BUG in EOSHIFT function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754197#M9717</link>
      <description>Of course, we do have a large test suite and add regression tests for every bug we fix. But I can tell you from my 33 years in the Fortran business, it is impossible to test every possible feature combination that people might try. I have seen bugs that were 25 years old show up for the first time. EOSHIFT is not a particularly common intrinsic, though I know we've had some use of it. Because it showed up in some benchmarks, we made an attempt to inline it and it's possible that this contributed to the problem you found.&lt;BR /&gt;&lt;BR /&gt;Once we fix it, it should stay fixed because we will test for it. But it's entirely possible, and I have seen this, that a slightly different program, one that you'd think was equivalent, excercised a new combination of code paths and triggered a seemingly identical bug. That's just the way it is with compilers.&lt;BR /&gt;&lt;BR /&gt;As for your comment about people staying with old versions - that's definitely not the norm. What I think is unusual about your program is that you assign to an array section with a lower bound not at the beginning of the array and you are using EOSHIFT - both of those are not common and the combination is even less so. That doesn't make it any less of a bug and we will fix it.</description>
      <pubDate>Wed, 06 Apr 2011 00:21:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754197#M9717</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-04-06T00:21:09Z</dc:date>
    </item>
    <item>
      <title>BUG in EOSHIFT function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754198#M9718</link>
      <description>mecej4,&lt;BR /&gt;There are many workarounds.&lt;BR /&gt;Here is another one that I prefer as it does not use the intrinsic and I hope&lt;BR /&gt;the array-slice syntax is interpreted correcly by any fortran 90/95 compiler&lt;BR /&gt;&lt;BR /&gt;ar(2:(7-2-1)) = a(2+1:(7-2-1)+1); ar(7-2)=0&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Apr 2011 00:23:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754198#M9718</guid>
      <dc:creator>Alex_S_5</dc:creator>
      <dc:date>2011-04-06T00:23:22Z</dc:date>
    </item>
    <item>
      <title>BUG in EOSHIFT function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754199#M9719</link>
      <description>This problem has been fixed in our sources. It should appear in a future update.</description>
      <pubDate>Fri, 10 Jun 2011 20:04:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/BUG-in-EOSHIFT-function/m-p/754199#M9719</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-06-10T20:04:29Z</dc:date>
    </item>
  </channel>
</rss>

