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

Compiler bug: Associate Name Created From Slice of Assumed Character Length Variable Has No Length

much_ado
Beginner
749 Views

ifx (IFX) 2024.0.0 20231017 has a bug where an associate-name created from slice of assumed character length variable has no length. The bug has been posted in HPC-Bugs/reproducers repo: https://github.com/HPC-Bugs/reproducers/tree/main/compiler/Fortran/ifx/associate-stmt. There is more information on the bug there, but the basics are also below.

 

Reproducer:

module mod_m
  implicit none

contains

    function func(line) result(returnVal)
      character(len=*) :: line
      integer :: returnVal

      associate(associateName => line(2:))
        returnVal = index(associateName, '"')
      end associate
    end function func

end module

 

Compiler error caused by above:

~/reproducers$ ifx example.f90
example.f90(11): error #5529: CHARACTER variable 'ASSOCIATENAME' has no length argument in routines with C or STDCALL attribute
        returnVal = index(associateName, '"')
--------------------------^
compilation aborted for example.f90 (code 1)

 

Thanks.

Labels (1)
1 Solution
Barbara_P_Intel
Employee
683 Views

@much_ado, I get the same error message that you do with ifx 2024.0.0. 

The good news is that with a preview of ifx version 2024.1.0 I do not get the message. I just typed "ifx -c much.f90". That release is planned to be available around the end of March or early April.

@jdelia, that's A LOT of compiler options! tried those and I still got the error message.

 

View solution in original post

3 Replies
jdelia
New Contributor I
705 Views

Hi much_ado:

Try with:

$ ifx (IFX) 2024.0.2 20231213
Copyright (C) 1985-2023 Intel Corporation. All rights reserved.

Then,

$ ifx -O2 -error-limit 4 -e03 -fimf-arch-consistency=true -fimf-precision=high -finline-functions -fp-model consistent -fpp -fpe-all=1 -ipo -mavx -mtune=generic -m64 -parallel-source-info=1 -qmkl -qopenmp -qopt-report=3 -standard-semantics -std18 -traceback -WB -warn all -xHost -c testcase-0197.f90  # (your source module)

$  

i.e. it is successfully compiled. The same with gfortran:

$ gfortran --version
GNU Fortran (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6)
Copyright (C) 2023 Free Software Foundation, Inc.
$ gfortran -march=native -mtune=native -m64 -fall-intrinsics -fcheck=all -fimplicit-none -fmax-errors=4 -fPIC -std=f2018 -Wall -Waliasing -Wrealloc-lhs-all -Wno-array-temporaries -Wcharacter-truncation -Wextra -Wimplicit-interface -Wimplicit-procedure -Wintrinsic-shadow -Wline-truncation -Wsurprising -Wtabs -Wunused-parameter -Wno-unused-function -flto -fgraphite-identity -O2 -c testcase-0197.f90 # (your source module)

$

i.e. is also successfully compiled.

Regards.

Jorge D'Elia.

0 Kudos
Barbara_P_Intel
Employee
684 Views

@much_ado, I get the same error message that you do with ifx 2024.0.0. 

The good news is that with a preview of ifx version 2024.1.0 I do not get the message. I just typed "ifx -c much.f90". That release is planned to be available around the end of March or early April.

@jdelia, that's A LOT of compiler options! tried those and I still got the error message.

 

much_ado
Beginner
622 Views

Thank you @Barbara_P_Intel for trying this out and letting me know that the upcoming version fixes this. That is great! Thanks!

0 Kudos
Reply