PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

detecting assignment of uninitialized variables

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
gunther



Joined: 26 Aug 2004
Posts: 1

PostPosted: Thu Aug 26, 2004 8:44 am    Post subject: detecting assignment of uninitialized variables Reply with quote

Hi all -
Just finished tracking down an f90 problem that turned out to have an assignment of an uninitialized variable at its root. I'm used to SGI compilers where -DEBUG:trap_uninitialized=ON at least allows for quick checking for uninitialized floats and pointers. I haven't been able to figure out an equivalent debugging switch for pgf90 - anyone have a quick way to trap on these errors?
Thanks.
Gunther
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6215
Location: The Portland Group Inc.

PostPosted: Thu Aug 26, 2004 5:52 pm    Post subject: Try "-Mchkptr" Reply with quote

Hi Gunther,


For pointers, pgf90 has a flag called "-Mchkptr" which will check if you are de-referencing a NULL pointer. "-Mbounds" will check for array out-of-bounds errors. However, there is not a flag to check for unitialized variables. Sorry.

- Mat
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6215
Location: The Portland Group Inc.

PostPosted: Fri Aug 27, 2004 7:50 am    Post subject: Future Feature Reply with quote

Hi Gunther,

I was talking to our lead compiler architect about maybe adding something to the compiler to detect unitialized variables. He thinks it would be very useful so he'll put it list of possible new features. We don't know when it would make it into a release, however.

Thanks,
Mat
Back to top
View user's profile
Ron Cohen



Joined: 23 Aug 2005
Posts: 3

PostPosted: Tue Aug 23, 2005 10:03 am    Post subject: uninitialized variables Reply with quote

I agree that it would be very valuable to have a compiler switch to test for uninitialized variables. Two switches would be useful, one that traps uninitailzied variables, and one that initializes variables to zero.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling 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