<?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 Re: Weird variable behaviour...maybe bug in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762701#M18188</link>
    <description>&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Steve,&lt;/P&gt;&lt;P&gt;It seems issue Q353876 is still not solved. What are your ideas concerning this bug. Will it be solved in a future release?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arnold&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jun 2006 14:50:00 GMT</pubDate>
    <dc:creator>harbers_a</dc:creator>
    <dc:date>2006-06-01T14:50:00Z</dc:date>
    <item>
      <title>Weird variable behaviour...maybe bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762694#M18181</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I've been having some problems with how a counter is being added up.... This counter is used as an index in a couple of arrays, and because its been behaving strangely I've had a lot of problems.&lt;/P&gt;&lt;P&gt;To better illustrate this I wrote a simple program that adds the counter as in my subroutine, and it has been appended at the end.&lt;/P&gt;&lt;P&gt;This program returns the following output:&lt;/P&gt;&lt;PRE&gt; Output first run:          32          24&lt;BR /&gt; q           8&lt;BR /&gt; q           9&lt;BR /&gt; q          14&lt;BR /&gt; q          15&lt;BR /&gt; Output second run:          24          24&lt;/PRE&gt;&lt;P&gt;The second run output is the correct one because the value of q must be 24 at the end. What I don't understand is why the first cycle (without the WRITE statement) acts so strangely so as to return such an erroneous value for q. Any suggestions or ideas?&lt;/P&gt;&lt;P&gt;The program has been compiled like this:&lt;/P&gt;&lt;PRE&gt;$ ifort nonesense.f90&lt;/PRE&gt;&lt;P&gt;My computer has Linux CentOS 4.2 installed, and is a Dell Inspiron 8100 laptop. With PIII processor (1 GHz), and 512MB of RAM.&lt;/P&gt;&lt;P&gt;I should notice that when compiled with gfortran (http://gcc.gnu.org/fortran/) I got the correct solutions in both cycles.&lt;/P&gt;&lt;P&gt;So is this maybe a bug????&lt;/P&gt;&lt;P&gt;Any input will be very much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;thanks,&lt;BR /&gt;Rodrigo.&lt;/PRE&gt;&lt;PRE&gt;PROGRAM nonsense&lt;BR /&gt;  IMPLICIT NONE&lt;BR /&gt;  &lt;BR /&gt;  INTEGER, PARAMETER :: nt = 4, nc = 3, nq = nt*(nc + 3)&lt;BR /&gt;  INTEGER :: i, q, k&lt;BR /&gt;&lt;BR /&gt;  q = 1&lt;BR /&gt;  DO i = 1, nc-1&lt;BR /&gt;     q = q + 1&lt;BR /&gt;  END DO&lt;BR /&gt;  &lt;BR /&gt;  q = q + 1 &lt;BR /&gt;  q = q + 1 &lt;BR /&gt;  q = q + 1 &lt;BR /&gt;  q = q + 1 &lt;BR /&gt;  &lt;BR /&gt;  DO k = 2, nt-1&lt;BR /&gt;     DO i = 1, nc-1&lt;BR /&gt;        q = q + 1&lt;BR /&gt;     END DO&lt;BR /&gt;     q = q + 1 &lt;BR /&gt;     q = q + 1 &lt;BR /&gt;     q = q + 1 &lt;BR /&gt;     q = q + 1 &lt;BR /&gt;  END DO&lt;BR /&gt;  &lt;BR /&gt;  DO i = 1, nc&lt;BR /&gt;     q = q + 1&lt;BR /&gt;  END DO&lt;BR /&gt;  q = q + 1&lt;BR /&gt;  q = q + 1&lt;BR /&gt;  &lt;BR /&gt;  WRITE (*,*) 'Output first run:',q, nq&lt;BR /&gt;&lt;BR /&gt;  q = 1&lt;BR /&gt;  DO i = 1, nc-1&lt;BR /&gt;     q = q + 1&lt;BR /&gt;  END DO&lt;BR /&gt;  &lt;BR /&gt;  q = q + 1 &lt;BR /&gt;  q = q + 1 &lt;BR /&gt;  q = q + 1 &lt;BR /&gt;  q = q + 1 &lt;BR /&gt;  &lt;BR /&gt;  DO k = 2, nt-1&lt;BR /&gt;     DO i = 1, nc-1&lt;BR /&gt;        q = q + 1&lt;BR /&gt;        WRITE(6,*) 'q',q&lt;BR /&gt;     END DO&lt;BR /&gt;     q = q + 1 &lt;BR /&gt;     q = q + 1 &lt;BR /&gt;     q = q + 1 &lt;BR /&gt;     q = q + 1 &lt;BR /&gt;  END DO&lt;BR /&gt;  &lt;BR /&gt;  DO i = 1, nc&lt;BR /&gt;     q = q + 1&lt;BR /&gt;  END DO&lt;BR /&gt;  q = q + 1&lt;BR /&gt;  q = q + 1&lt;BR /&gt;  &lt;BR /&gt;  WRITE (*,*) 'Output second run:',q, nq&lt;BR /&gt;END PROGRAM nonsense&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Feb 2006 08:26:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762694#M18181</guid>
      <dc:creator>soyrush</dc:creator>
      <dc:date>2006-02-17T08:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Weird variable behaviour...maybe bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762695#M18182</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;seems to be a bug in optimization. -g gives correct results.&lt;/P&gt;
&lt;P&gt;Report to intel premier support.&lt;/P&gt;
&lt;P&gt;Hans&lt;/P&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2006 16:24:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762695#M18182</guid>
      <dc:creator>hanswb</dc:creator>
      <dc:date>2006-02-17T16:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Weird variable behaviour...maybe bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762696#M18183</link>
      <description>It may not even be optimization - I see the same problem with -O0.  Please do report it.  Thanks.</description>
      <pubDate>Fri, 17 Feb 2006 22:21:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762696#M18183</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2006-02-17T22:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Weird variable behaviour...maybe bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762697#M18184</link>
      <description>Ok... I've reported it to intel premier support. &lt;BR /&gt;thanks to all.</description>
      <pubDate>Sat, 18 Feb 2006 02:46:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762697#M18184</guid>
      <dc:creator>soyrush</dc:creator>
      <dc:date>2006-02-18T02:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Weird variable behaviour...maybe bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762698#M18185</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Rodrigo,&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Any news yet from Premier Intel?&lt;/DIV&gt;&lt;DIV&gt;The latestversion (Build 20060222 Package ID: l_fc_c_9.0.033) has the same behaviour.&lt;/DIV&gt;&lt;DIV&gt;Seems that it is not solved yet.&lt;/DIV&gt;&lt;DIV&gt;Please keep us up to date.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;Arnold&lt;BR /&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Apr 2006 19:20:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762698#M18185</guid>
      <dc:creator>harbers_a</dc:creator>
      <dc:date>2006-04-12T19:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Weird variable behaviour...maybe bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762699#M18186</link>
      <description>I can't locate Rodrigo's support request, but the current update was built before he would have reported it.</description>
      <pubDate>Wed, 12 Apr 2006 22:04:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762699#M18186</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2006-04-12T22:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Weird variable behaviour...maybe bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762700#M18187</link>
      <description>Hi everyone,&lt;BR /&gt;&lt;BR /&gt;I did report the bug. I got issued the number 353876. I reported the problem with version 9.0.031. I haven't upgraded since, so I don't know if the newer vesions have the same behaviour. The only reply I've got from Intel Premier is at the end of this post.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;rodrigo&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;_________________________&lt;BR /&gt;&lt;BR /&gt;Hi Rodrigo,&lt;BR /&gt;&lt;BR /&gt;Thank you for contacting about this incorrect result. My initial testing suggests our compiler is incorrectly optimizing variable q in the first run which leads to the incorrect result of 32. If you disable optimization by compiling your program with -O0 the results for the first run match the expected result as returned for the second run.&lt;BR /&gt;&lt;BR /&gt;I will investigate this further and direct it to the proper compiler development team and keep you updated on their investigation and any fix that may result.&lt;BR /&gt;&lt;BR /&gt;If this test case was derived from a larger subroutine, as a work-around, you can compile that subroutine without optimization, -O0, for now.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;Kevin Davis&lt;BR /&gt;Intel Compiler Support&lt;P&gt;Message Edited by soyrush@gmail.com on &lt;SPAN class="date_text"&gt;04-12-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;12:22 PM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2006 02:19:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762700#M18187</guid>
      <dc:creator>soyrush</dc:creator>
      <dc:date>2006-04-13T02:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Weird variable behaviour...maybe bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762701#M18188</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Steve,&lt;/P&gt;&lt;P&gt;It seems issue Q353876 is still not solved. What are your ideas concerning this bug. Will it be solved in a future release?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arnold&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2006 14:50:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762701#M18188</guid>
      <dc:creator>harbers_a</dc:creator>
      <dc:date>2006-06-01T14:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Weird variable behaviour...maybe bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762702#M18189</link>
      <description>Sorry, I have no new information on this issue. If we get any, either I or Kevin will let you know.</description>
      <pubDate>Thu, 01 Jun 2006 19:50:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Weird-variable-behaviour-maybe-bug/m-p/762702#M18189</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2006-06-01T19:50:13Z</dc:date>
    </item>
  </channel>
</rss>

