<?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: Bug with EQUIVALENCE ? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435914#M163901</link>
    <description>&lt;P&gt;What exactly do you think the bug is?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;D:\Projects&amp;gt;ifort -c t.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.7.1 Build 20221019_000000
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.

t.f90(10): error #6401: The attributes of this name conflict with those made accessible by a USE statement.   [A]
EQUIVALENCE (A, B)
-------------^
t.f90(10): error #6401: The attributes of this name conflict with those made accessible by a USE statement.   [B]
EQUIVALENCE (A, B)
----------------^
compilation aborted for t.f90 (code 1)&lt;/LI-CODE&gt;
&lt;P&gt;For comparison, here is NAG Fortran:&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;D:\Projects&amp;gt;nagfor -c t.f90
NAG Fortran Compiler Release 7.1(Hanzomon) Build 7114
Error: t.f90, line 10: Redeclaration of symbol A from USEd module M
       detected at (@A
Error: t.f90, line 10: Redeclaration of symbol B from USEd module M
       detected at ,@B
[NAG Fortran Compiler pass 1 error termination, 2 errors]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Dec 2022 20:00:49 GMT</pubDate>
    <dc:creator>Steve_Lionel</dc:creator>
    <dc:date>2022-12-05T20:00:49Z</dc:date>
    <item>
      <title>Bug with EQUIVALENCE ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435909#M163899</link>
      <description>&lt;P&gt;The following code triggers (what I believe to be) a bug with both the latest versions of ifort and ifx:&lt;/P&gt;
&lt;P&gt;Note that the compilers do not complain when the module M is not used and instead the variables A and B are declared in P.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;MODULE M
IMPLICIT NONE
REAL :: A, B
END MODULE M

PROGRAM P
USE M
IMPLICIT NONE
!REAL :: A, B
EQUIVALENCE (A, B)
END PROGRAM P&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 19:33:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435909#M163899</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2022-12-05T19:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with EQUIVALENCE ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435914#M163901</link>
      <description>&lt;P&gt;What exactly do you think the bug is?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;D:\Projects&amp;gt;ifort -c t.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.7.1 Build 20221019_000000
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.

t.f90(10): error #6401: The attributes of this name conflict with those made accessible by a USE statement.   [A]
EQUIVALENCE (A, B)
-------------^
t.f90(10): error #6401: The attributes of this name conflict with those made accessible by a USE statement.   [B]
EQUIVALENCE (A, B)
----------------^
compilation aborted for t.f90 (code 1)&lt;/LI-CODE&gt;
&lt;P&gt;For comparison, here is NAG Fortran:&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;D:\Projects&amp;gt;nagfor -c t.f90
NAG Fortran Compiler Release 7.1(Hanzomon) Build 7114
Error: t.f90, line 10: Redeclaration of symbol A from USEd module M
       detected at (@A
Error: t.f90, line 10: Redeclaration of symbol B from USEd module M
       detected at ,@B
[NAG Fortran Compiler pass 1 error termination, 2 errors]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 20:00:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435914#M163901</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2022-12-05T20:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with EQUIVALENCE ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435917#M163902</link>
      <description>&lt;P&gt;Thanks Steve - I understand what is going on now, you're right this is the expected behavior.&lt;/P&gt;
&lt;P&gt;This came up during an exercise of porting a (very) old code with COMMON blocks galore and replacing those with modules. But now I am a bit puzzled about how that old code worked in the first place, ha ha. I need to take a deeper look at this.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 20:15:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435917#M163902</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2022-12-05T20:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with EQUIVALENCE ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435920#M163903</link>
      <description>&lt;P&gt;With COMMON, each program unit had its own declaration of the COMMON, and EQUIVALENCE within the COMMON was fine. Of course, you were responsible for making sure that the overall length of the named COMMON was the same across all program units, and ideally, use of EQUIVALENCE didn't change the meaning of the variables in the block. The recommended practice was to put all the COMMON and EQUIVALENCE declarations in an include file, and include this everywhere. (Note that INCLUDE wasn't standard until Fortran 90, though it did appear in &lt;A href="https://stevelionel.com/drfortran/2020/05/16/doctor-fortran-in-military-strength/" target="_blank" rel="noopener"&gt;MIL-STD-1753&lt;/A&gt;.) Any DATA statements should be confined to a BLOCK DATA subprogram that included the COMMON definitions.&lt;/P&gt;
&lt;P&gt;If replacing the COMMON with module variables, any EQUIVALENCE would need to be in the same module where the variables were declared. Maybe that is the issue you ran into?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 20:33:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435920#M163903</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2022-12-05T20:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with EQUIVALENCE ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435940#M163904</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/5442"&gt;@Steve_Lionel&lt;/a&gt;&amp;nbsp;, your prescience is amazing... what you described is exactly what happened. The fix is straightforward, as you noted (and reorganizing the code to get rid of EQUIVALENCE would be even better, of course).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 21:55:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435940#M163904</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2022-12-05T21:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with EQUIVALENCE ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435951#M163905</link>
      <description>&lt;P&gt;Glad to hear it. Getting rid of EQUIVALENCE may be hard or easy, depending on why it was used in the first place.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 22:22:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-EQUIVALENCE/m-p/1435951#M163905</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2022-12-05T22:22:35Z</dc:date>
    </item>
  </channel>
</rss>

