Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Ankündigungen
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Parameter expression bugs

JFH
Neuer Beitragender I
1.290Aufrufe

Ifx -stand f23 gives 3 error messages for this program, but the type parameter inquiry x%kind and aimag(z) in a constant expression both became valid Fortran in 2003; the complex part designator x%im became valid Fortran in 2008. F2023 5.4.3.2.4 implies that a subobject need not be a variable. The program and its compile-time messages:
```
program imconsts
implicit none ! file imconsts.f90
complex,parameter :: z = (5,7)/9.0
integer,parameter :: zk = z%kind
real ,parameter :: zi1 = aimag(z), zi2 = z%im
print "(I0,2F10.7)", zk, zi1, zi2
end program imconsts


(lf) john:~$ intel/oneapi/compiler/2025.1/bin/ifx -stand f23 imconsts.f90
imconsts.f90(4): error #7747: Invalid parameter expression. [Z]
integer,parameter :: zk = z%kind
-----------------------------^
imconsts.f90(5): warning #6009: Fortran 2023 specifies that an elemental intrinsic function here be of type integer or character and each argument must be an initialization expr of type integer or character. [AIMAG]
real ,parameter :: zi1 = aimag(z), zi2 = z%im
-----------------------------^
imconsts.f90(5): error #7747: Invalid parameter expression. [Z]
real ,parameter :: zi1 = aimag(z), zi2 = z%im
---------------------------------------------^
compilation aborted for imconsts.f90 (code 1)
```

Beschriftungen (2)
0 Kudos
3 Antworten
andrew_4619
Geehrter Beitragender III
1.219Aufrufe

There have been numerous IFX bugs reported relating to constant expressions to define a parameter. Do a forum search yours might be a repeat.

JFH
Neuer Beitragender I
1.172Aufrufe

The only repeat I found is that the %kind bug was said to have been fixed in ifx 2025.0 but it's back again in 2025.1. See @sblionel's bug report and the reply in these screenshots:

 

taehunkim
Mitarbeiter
1.065Aufrufe

Hi,

We also found that ifx does not support for the initialization of the derived type in the declaration section and started triaging it with development team.

Thanks.

Antworten