Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
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.

OpenMP and variables named "alloc"

jhogg41
Beginner
956 Views

I've just run across a funny bug that someone might be able to unmystify/fix for me. Consider the following code

subroutine task_bug()
!$ use omp_lib
   implicit none

   integer :: alloc

!$OMP TASK SHARED(alloc)
   print *, "Hello from thread ", omp_get_thread_num(), "alloc = ", alloc
!$OMP END TASK
end subroutine task_bug

We get the following unusual error when compiling

[xxx@yyy] ~/temp/ifort_bug$ ifort -c -openmp test.f90 
test.f90(7): error #5082: Syntax error, found 'ALLOC' when expecting one of: <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> /
!$OMP TASK SHARED(alloc)
------------------^
compilation aborted for test.f90 (code 1)
[xxx@yyy] ~/temp/ifort_bug$ ifort --version
ifort (IFORT) 14.0.0 20130728
Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.

The bug goes away if we rename the variable alloc to, say, alloc2.

Thanks,

Jonathan.

0 Kudos
4 Replies
Steven_L_Intel1
Employee
956 Views

Thanks - we'll investigate.

0 Kudos
jhogg41
Beginner
956 Views

Fixing code formatting (rich text seems to bungle things):

I've just run across a funny bug that someone might be able to unmystify/fix for me. Consider the following code

[fortran] subroutine task_bug() !$ use omp_lib implicit none integer :: alloc !$OMP TASK SHARED(alloc) print *, "Hello from thread ", omp_get_thread_num(), "alloc = ", alloc !$OMP END TASK end subroutine task_bug [/fortran]

We get the following unusual error when compiling

[bash] [xxx@yyy] ~/temp/ifort_bug$ ifort -c -openmp test.f90 test.f90(7): error #5082: Syntax error, found 'ALLOC' when expecting one of: / !$OMP TASK SHARED(alloc) ------------------^ compilation aborted for test.f90 (code 1) [xxx@yyy] ~/temp/ifort_bug$ ifort --version ifort (IFORT) 14.0.0 20130728 Copyright (C) 1985-2013 Intel Corporation. All rights reserved. [/bash]

The bug goes away if we rename the variable alloc to, say, alloc2.

Thanks,

Jonathan.

 

 

0 Kudos
Steven_L_Intel1
Employee
956 Views

Escalated as issue DPD200253067.

0 Kudos
Steven_L_Intel1
Employee
956 Views

This has been fixed for a future release.

0 Kudos
Reply