<?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 Yes, it's a compiler bug. You in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091728#M124426</link>
    <description>&lt;P&gt;Yes, it's a compiler bug. You want an article? Ok! &lt;A href="https://software.intel.com/en-us/blogs/2008/03/31/doctor-it-hurts-when-i-do-this" target="_blank"&gt;https://software.intel.com/en-us/blogs/2008/03/31/doctor-it-hurts-when-i-do-this&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Apr 2017 15:25:00 GMT</pubDate>
    <dc:creator>Steve_Lionel</dc:creator>
    <dc:date>2017-04-26T15:25:00Z</dc:date>
    <item>
      <title>Runtime Error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091725#M124423</link>
      <description>&lt;P&gt;Hello:&lt;BR /&gt;
	&lt;BR /&gt;
	I am getting a runtime error, and I was hoping that somebody could help explain to me exactly what is going on.&amp;nbsp; I am running windows 10, Visual Studio 2015, and&amp;nbsp;compiler version 17.0.2.187, in Debug Mode.&amp;nbsp; When I run in Release Mode there is no runtime error (which doesn't&amp;nbsp;surprise me).&amp;nbsp; And if rollback to&amp;nbsp;use the XE 15.0.4.221 compiler, I also don't get an error (even in Debug Mode).&lt;BR /&gt;
	&lt;BR /&gt;
	I have stripped down the program to create a simple example that still gives me the runtime error. I have attached the solution file, project file,&amp;nbsp;source code&amp;nbsp;file, and the input file.&amp;nbsp; Since it's a pretty short sample program, I'll paste it here for convenience:&lt;/P&gt;

&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;program&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; Test&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp; call&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; TempSub(1)&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;contains&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;subroutine&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; TempSub(low)&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp; integer&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; :: low&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp; integer&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; :: intVar&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;
	&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp; double precision&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;dimension&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(low:2) :: arr&lt;BR /&gt;
	&lt;BR /&gt;
	&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;open&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(unit=13,file=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"test.txt"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;)&lt;BR /&gt;
	&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;read&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(13,*) intVar,arr(:)&lt;BR /&gt;
	&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;close&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(13)&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;end subroutine&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; TempSub&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;end program&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; Test&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	The error I get is:&lt;BR /&gt;
	&lt;BR /&gt;
	forrtl: severe (157): Program Exception - access violation&lt;BR /&gt;
	&lt;BR /&gt;
	And it tells me that it happens on line 15 (the "read") line.&amp;nbsp; If I change line 15 from:&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;read&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(13,*) intVar,arr(:)&lt;BR /&gt;
	&lt;BR /&gt;
	to:&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;read&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(13,*) intVar,arr&lt;BR /&gt;
	&lt;BR /&gt;
	then it also runs fine (no runtime error).&lt;BR /&gt;
	&lt;BR /&gt;
	Can someone please explain to me what's going on with this short piece of code?&amp;nbsp; I'm not sure if what I'm trying to do is illegal, or if perhaps this is a compiler bug.&lt;BR /&gt;
	&lt;BR /&gt;
	Thanks for your help.&lt;BR /&gt;
	Michael&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 20:47:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091725#M124423</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2017-04-25T20:47:29Z</dc:date>
    </item>
    <item>
      <title>What you are doing is</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091726#M124424</link>
      <description>&lt;P&gt;What you are doing is perfectly valid - a runtime error would be inappropriate. But I do generally recommend against using (:) to say "hey, this is an array!", as in some cases it can bite you. One of the Intel folk will take a look.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 21:00:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091726#M124424</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2017-04-25T21:00:16Z</dc:date>
    </item>
    <item>
      <title>Thanks.  So basically you're</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091727#M124425</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; So basically you're saying that there is not a coding error, but maybe this is a bug in the compiler.&amp;nbsp; Is that right?&lt;BR /&gt;
	&lt;BR /&gt;
	But you're also saying that even though there's technically no coding error, the coding style should be avoided.&amp;nbsp; Can you elaborate a little bit (or perhaps provide a link&amp;nbsp;to a useful article)&amp;nbsp;on why/how this coding style would not be best practice?&lt;BR /&gt;
	&lt;BR /&gt;
	Thanks.&lt;BR /&gt;
	Michael&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 13:02:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091727#M124425</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2017-04-26T13:02:58Z</dc:date>
    </item>
    <item>
      <title>Yes, it's a compiler bug. You</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091728#M124426</link>
      <description>&lt;P&gt;Yes, it's a compiler bug. You want an article? Ok! &lt;A href="https://software.intel.com/en-us/blogs/2008/03/31/doctor-it-hurts-when-i-do-this" target="_blank"&gt;https://software.intel.com/en-us/blogs/2008/03/31/doctor-it-hurts-when-i-do-this&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 15:25:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091728#M124426</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2017-04-26T15:25:00Z</dc:date>
    </item>
    <item>
      <title>Thanks for clarifying, and</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091729#M124427</link>
      <description>&lt;P&gt;Thanks for clarifying, and thanks for the link to that article.&amp;nbsp; Very helpful!&lt;BR /&gt;
	&lt;BR /&gt;
	Michael&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 17:40:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091729#M124427</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2017-04-26T17:40:56Z</dc:date>
    </item>
    <item>
      <title>The error occurs in relation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091730#M124428</link>
      <description>&lt;P&gt;The error occurs in relation to the Debug build having &lt;STRONG&gt;/check:bounds&lt;/STRONG&gt; enabled. You can avoid it by making the suggested source modification or for the Debug build disabling (setting to &lt;STRONG&gt;No&lt;/STRONG&gt;) bounds checking under the IDE via &lt;STRONG&gt;Properties &amp;gt; Fortran &amp;gt; Run-time &amp;gt; Check Array and String Bounds&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;As Steve indicated, this should not result in a run-time failure with bounds checking enabled. I reported that to Development.&amp;nbsp; This appears to be a regression with our 17.0 release. The test case compiles/runs successfully with pre-17.0 releases. Thank you also&amp;nbsp;for the convenient test case.&lt;/P&gt;

&lt;P&gt;(Internal tracking id: CMPLRS-42642)&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 17:59:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091730#M124428</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2017-04-26T17:59:10Z</dc:date>
    </item>
    <item>
      <title>Thanks for reporting it to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091731#M124429</link>
      <description>&lt;P&gt;Thanks for reporting it to Development, and for that alternate workaround.&amp;nbsp; That may be a&amp;nbsp;helpful alternative&amp;nbsp;for some of our programs that were running into this issue.&lt;BR /&gt;
	&lt;BR /&gt;
	Michael&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 19:08:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091731#M124429</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2017-04-26T19:08:12Z</dc:date>
    </item>
    <item>
      <title>One point of the article</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091732#M124430</link>
      <description>&lt;P&gt;One point of the article needs updating, but I can't do that anymore (maybe I can convince Kevin to do it for me?)&lt;/P&gt;

&lt;P&gt;It's where I write:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 14px;"&gt;This is why Intel Fortran does not support this F2003 feature by default - you have to ask for it with the option /assume:realloc_lhs, or for Linux and Mac users, -assume realloc_lhs. ("lhs" here means "left hand side".)&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 14px;"&gt;This was true when I wrote it in 2008, but as of compiler version 17 the F2003 behavior is the default.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 14px;"&gt;However, on revisiting this article I see I made a horrible error that nobody has called me on in seven years! It's this paragraph:&lt;/SPAN&gt;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 14px;"&gt;But there's another case where the (:) can bite you.&amp;nbsp; If you are calling a procedure where the corresponding dummy argument is a deferred-shape array, then there is a difference in meaning to passing the array name A and passing A(:).&amp;nbsp; If you just pass A, then the lower bound(s) are passed along and are reflected in the dummy argument inside the called routine.&amp;nbsp; However, if you pass A(:), that's an array section and the lower bound is 1, no matter what you declared it as originally.&amp;nbsp; This will change how the array is indexed in the called procedure and can cause array bounds violation errors.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This entire paragraph is simply wrong - the only time the array bounds are passed is when the dummy argument is a POINTER - in all other cases the lower bound is 1 and the upper bound is the extent of the dimension. This paragraph should be deleted. Kevin, would you please do the honors?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2017 14:47:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091732#M124430</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2017-04-27T14:47:45Z</dc:date>
    </item>
    <item>
      <title>Happy to do that Steve and</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091733#M124431</link>
      <description>&lt;P&gt;Happy to do that Steve and have done so.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2017 18:34:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091733#M124431</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2017-04-27T18:34:43Z</dc:date>
    </item>
    <item>
      <title>Perfect - thanks! (Me so</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091734#M124432</link>
      <description>&lt;P&gt;Perfect - thanks! (Me so embarassed!)&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2017 19:22:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Runtime-Error/m-p/1091734#M124432</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2017-04-27T19:22:32Z</dc:date>
    </item>
  </channel>
</rss>

