OpenMP and variables named "alloc"

OpenMP and variables named "alloc"

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.

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Thanks - we'll investigate.

Steve - Intel Developer Support

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


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:     /

!$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.

 

 

Escalated as issue DPD200253067.

Steve - Intel Developer Support

This has been fixed for a future release.

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today