Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28895 Discussions

Visual Studio watch window works for common blocks in x86 but not for x64

Bryan_H_1
Novice
699 Views

The IFX compiler is not showing common blocks in the debugger watch window.  The code below shows DATA.Var1 as expected in the Visual Studio watch window.

 

PROGRAM WatchTest

STRUCTURE /S_DATA /
REAL Var1
END STRUCTURE

!COMMON /C_DATA/ DATA
RECORD /S_DATA/ DATA

DATA.Var1 = 5.0

END PROGRAM

 

However, if I remove the "!" to activate the COMMON block the DATA.Var1 does not show in the Visual Studio watch window.  Instead, it gives me "Invalid structure member 'Var1'".

 

I am using:

Intel Fortran Compiler 2024.1

Visual Studio 17.11.4

 

Thanks.

 

HAPPY_x86_Commonblock_WatchlistTestHAPPY_x86_Commonblock_WatchlistTestSAD_x64_CommonBlock_WatchListTestSAD_x64_CommonBlock_WatchListTestHAPPY_x64_NoCommonBlock_WatchListTestHAPPY_x64_NoCommonBlock_WatchListTest

 

 

Labels (3)
0 Kudos
7 Replies
Ron_Green
Moderator
642 Views

You may have a fundamental misunderstanding of named common.  Common defines a storage area with global scope.  It is NOT a derived type or structure.  for COMMON / C_DATA /, the variable VAR1 is NOT a component, since DATA is not a structure. 

I am surprised this even compiled for you.  I am using a prebuild of 2025.0 and ifx rejects your syntax

Data.Var1 = 5.0

with a compiler error #6535 "This variable or component must be of derived or structure type". 

For Data in C_COMMON the syntax should be

   Var1 = 5.0

 

Correct understand of the common declaration you have is this:

There is a global storage area named "C_DATA".

In this storage area is a kind REAL variable named "Var1" that you can reference as "Var1".

It is not a structure.  

 

 

0 Kudos
Bryan_H_1
Novice
588 Views

Hi Ron,

 

Thanks for your time.  I see my example was poorly chosen.  Please consider the updated example below.  It tries to follow the partial sample in the intel help: COMMON (intel.com), 

 

The help does show that common blocks can include structured types.  This does run and work, the only issue is that the debugger in IFX isn't able to resolve club(1).a in the watch window.

 

If the example below is still not an acceptable use of COMMON, an example of the correct use of structures in COMMON blocks is greatly appreciated.

 

PROGRAM MAIN

STRUCTURE /member/
REAL a
END STRUCTURE

RECORD /member/ club(50)
COMMON /blocka/ club

club(1).a = 5.0

WRITE(*,*) club(1).a

END PROGRAM

andrew_4619
Honored Contributor III
534 Views
program main

type :: member
    sequence
    real a
end type

type(member) :: club(50)
common /blocka/ club

club(1)%a = 5.0

write(*,*) club(1)%a

end program

Out of curiosity I rewrote the sample in conforming Fortran removing the ancient and non-standard STRUCTURE/RECORD syntax to see if that was part of the problem.   I can conform that club(1)%a cannot be watched in the debugger. As noted by the OP commenting out line 9 , the common definition enables  club(1)%a to be watched.  I would  suggest this is a bug in the integrations it works in IFORT btw.

Devorah_H_Intel
Moderator
505 Views

I will investigate this further and update you. Thank you for your report.  @Bryan_H_1 @andrew_4619 

0 Kudos
Bryan_H_1
Novice
293 Views

Hi Devorah,

 

Are there any status updates you can share, or any issue/bug tracking link I can follow?  Thanks.

0 Kudos
Devorah_H_Intel
Moderator
264 Views

@Bryan_H_1 wrote:

Hi Devorah,

 

Are there any status updates you can share, or any issue/bug tracking link I can follow?  Thanks.


The compiler engineering team is fixing the case. The fix is targeted for the 2025.1 version of the compiler since it is too late for the 2025.0 release. 

0 Kudos
andrew_4619
Honored Contributor III
502 Views

I should have noted also that the IFORT/IFX tests were both 64 bit.

Reply