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

OpenMP and variables named "alloc"

jhogg41
Beginner
1,104 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
1,104 Views

Thanks - we'll investigate.

0 Kudos
jhogg41
Beginner
1,104 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
1,104 Views

Escalated as issue DPD200253067.

0 Kudos
Steven_L_Intel1
Employee
1,104 Views

This has been fixed for a future release.

0 Kudos
Reply