<?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: Compiler bug: value attribute not working in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576239#M171089</link>
    <description>&lt;P&gt;Hi Lionel_Guez :&lt;/P&gt;&lt;P&gt;Try with&lt;/P&gt;&lt;P&gt;$ ifx --version&lt;BR /&gt;ifx (IFX) 2024.0.2 20231213&lt;BR /&gt;Copyright (C) 1985-2023 Intel Corporation. All rights reserved.&lt;/P&gt;&lt;P&gt;$ ifx -error-limit 4 -e03 -fimf-arch-consistency=true -fimf-precision=high -finline-functions -fpp -ipo -mtune=generic -m64 -mavx -parallel-source-info=1 -qopenmp -qmkl -xHost -O2 -qopt-report=3 -parallel-source-info -std18 -fp-model consistent -WB -warn all -o testcase-0195-ifx.exe testcase-0195.f90 # (your source code)&lt;/P&gt;&lt;P&gt;$ $ testcase-0195-ifx.exe&lt;BR /&gt;T&lt;BR /&gt;p%points = 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00&lt;BR /&gt;0.0000000E+00 0.0000000E+00&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Jorge D'Elia&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2024 11:29:19 GMT</pubDate>
    <dc:creator>jdelia</dc:creator>
    <dc:date>2024-02-28T11:29:19Z</dc:date>
    <item>
      <title>Compiler bug: value attribute not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576228#M171085</link>
      <description>&lt;P&gt;Hello. Here is a test execution:&lt;/P&gt;&lt;PRE&gt;$ ifort --version&lt;BR /&gt;ifort (IFORT) 2021.9.0 20230302&lt;BR /&gt;Copyright (C) 1985-2023 Intel Corporation. All rights reserved.&lt;BR /&gt;&lt;BR /&gt;$ cat test_value_attribute.f90&lt;BR /&gt;module func_value_attr_m&lt;BR /&gt;  implicit none&lt;BR /&gt;  type polyline&lt;BR /&gt;    integer n_points&lt;BR /&gt;    logical closed&lt;BR /&gt;    real, allocatable:: points(:, &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;BR /&gt;  end type polyline&lt;BR /&gt;contains&lt;BR /&gt;  logical function func_value_attr(p)&lt;BR /&gt;    type(polyline), value:: p&lt;BR /&gt;    p%points(:, 3) = [1., 2.]&lt;BR /&gt;    func_value_attr = sum(p%points) &amp;gt;= 0.&lt;BR /&gt;  end function func_value_attr&lt;BR /&gt;end module func_value_attr_m&lt;BR /&gt;program test_value_attribute&lt;BR /&gt;  use func_value_attr_m, only: polyline, func_value_attr&lt;BR /&gt;  implicit none&lt;BR /&gt;  type(polyline) p&lt;BR /&gt;  real points(2, 3)&lt;BR /&gt;  points = 0.&lt;BR /&gt;  p = polyline(n_points = 3, closed = .false., points = points)&lt;BR /&gt;  print *, func_value_attr(p)&lt;BR /&gt;  print *, "p%points = ", p%points&lt;BR /&gt;end program test_value_attribute&lt;BR /&gt;&lt;BR /&gt;$ ifort test_value_attribute.f90&lt;BR /&gt;&lt;BR /&gt;$ a.out&lt;BR /&gt;T&lt;BR /&gt;p%points = 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00&lt;BR /&gt;1.000000 2.000000 &lt;/PRE&gt;&lt;P&gt;This is a compiler bug. The variable "p" should not be modified by the call to the function, since the dummy argument has the value attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you correct this bug?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 10:39:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576228#M171085</guid>
      <dc:creator>Lionel_Guez</dc:creator>
      <dc:date>2024-02-28T10:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler bug: value attribute not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576229#M171086</link>
      <description>&lt;P&gt;You misunderstand the purpose of the value attribute: it does not protect against &lt;EM&gt;local&lt;/EM&gt; changes of an argument. Instead it protect against the actual argument being changed, while you still can change it in a subprogram. If you want to ensure that the dummy argument cannot be changed, use the intent(in) attribute.&lt;/P&gt;&lt;P&gt;The "value" attribute is also useful if you interface with C: rather than passing by reference, it allows you to pass an argument by value.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 10:45:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576229#M171086</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2024-02-28T10:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler bug: value attribute not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576231#M171087</link>
      <description>&lt;P&gt;Thank you for your answer. I am sorry but I think you are wrong. Here is a quote from the&amp;nbsp; Fortran 2003 standard, § 12.4.1.2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"If the dummy argument has the VALUE attribute it becomes associated with a definable anonymous data object whose initial value is that of the actual argument. Subsequent changes to the value or definition status of the dummy argument do not affect the actual argument."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Applied to my test program, the above specification says that a change to the value of the dummy argument "p" shall not affect the variable "p" in the main program.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 10:57:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576231#M171087</guid>
      <dc:creator>Lionel_Guez</dc:creator>
      <dc:date>2024-02-28T10:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler bug: value attribute not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576233#M171088</link>
      <description>&lt;P&gt;Oh, I misread your message. The actual argument is changed, where that should not happen. Hm.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 11:00:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576233#M171088</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2024-02-28T11:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler bug: value attribute not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576239#M171089</link>
      <description>&lt;P&gt;Hi Lionel_Guez :&lt;/P&gt;&lt;P&gt;Try with&lt;/P&gt;&lt;P&gt;$ ifx --version&lt;BR /&gt;ifx (IFX) 2024.0.2 20231213&lt;BR /&gt;Copyright (C) 1985-2023 Intel Corporation. All rights reserved.&lt;/P&gt;&lt;P&gt;$ ifx -error-limit 4 -e03 -fimf-arch-consistency=true -fimf-precision=high -finline-functions -fpp -ipo -mtune=generic -m64 -mavx -parallel-source-info=1 -qopenmp -qmkl -xHost -O2 -qopt-report=3 -parallel-source-info -std18 -fp-model consistent -WB -warn all -o testcase-0195-ifx.exe testcase-0195.f90 # (your source code)&lt;/P&gt;&lt;P&gt;$ $ testcase-0195-ifx.exe&lt;BR /&gt;T&lt;BR /&gt;p%points = 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00&lt;BR /&gt;0.0000000E+00 0.0000000E+00&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Jorge D'Elia&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 11:29:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576239#M171089</guid>
      <dc:creator>jdelia</dc:creator>
      <dc:date>2024-02-28T11:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler bug: value attribute not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576263#M171090</link>
      <description>&lt;P&gt;Thanks. The most recent version I have access to is:&lt;/P&gt;&lt;PRE&gt;$ ifx --version&lt;BR /&gt;ifx (IFX) 2023.1.0 20230320&lt;BR /&gt;Copyright (C) 1985-2023 Intel Corporation. All rights reserved.&lt;BR /&gt;&lt;BR /&gt;$ ifx test_value_attribute.f90&lt;BR /&gt;&lt;BR /&gt;$ a.out&lt;BR /&gt;T&lt;BR /&gt;p%points = 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00&lt;BR /&gt;1.000000 2.000000&lt;/PRE&gt;&lt;P&gt;So the bug has been fixed somewhere between versions 2023.1.0 and 2024.0.2. That is good to know. Thanks again.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 13:21:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-value-attribute-not-working/m-p/1576263#M171090</guid>
      <dc:creator>Lionel_Guez</dc:creator>
      <dc:date>2024-02-28T13:21:51Z</dc:date>
    </item>
  </channel>
</rss>

