PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

cray pointers and boundary checking

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Senya



Joined: 20 Jun 2011
Posts: 58

PostPosted: Sun Jul 15, 2012 4:55 pm    Post subject: cray pointers and boundary checking Reply with quote

Boundary checking doesn't work with cray pointers.

Code:

module m
    real :: A(8)
    real*8 :: B(:)
   
    contains
    subroutine init
      pointer (pB,B)
      pB = LOC(A)
    end
end

program P
  use m
  A(2)=pi
  print*, B(2)
end


This code, if compiled with -C flag, produces output:
Code:

fenixk19@fenixk19-desktop /tmp> pgf95 -C cray_test.f95
fenixk19@fenixk19-desktop /tmp> ./a.out
0: Subscript out of range for array b (cray_test.f95: 15)
    subscript=2, lower bound=0, upper bound=-1, dimension=1
fenixk19@fenixk19-desktop /tmp>


Is that bug? Or it is ok? If so, what is the right way to work with data of different types, but placed in same memory?
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group