PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

This code compile OK with v.6.0 not v.6.1-2... is it a bug ?

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



Joined: 21 Apr 2006
Posts: 6

PostPosted: Fri Apr 21, 2006 1:36 am    Post subject: This code compile OK with v.6.0 not v.6.1-2... is it a bug ? Reply with quote

Hi,

I can compile a prog with pfg90 v6.0 but not v6.1-2
Here's the prog :

----------------------------------------------------------------------------------
PROGRAM essai
IMPLICIT NONE

INTEGER PNB_EPHNUM_QUALITE
PARAMETER (PNB_EPHNUM_QUALITE = 100)
DOUBLE PRECISION PXPASEPHNUM
PARAMETER (PXPASEPHNUM = EPSILON(1.d0))
DOUBLE PRECISION PXPASQEPHFINES
PARAMETER (PXPASQEPHFINES= dble(PNB_EPHNUM_QUALITE) * PXPASEPHNUM) <----- here's the bug

WRITE(*,*) "Hello World"


WRITE (*,*) PXPASQEPHFINES, EPSILON(1.d0)*DBLE(PNB_EPHNUM_QUALITE), PXPASQEPHFINES - EPSILON(1.d0)*DBLE(PNB_EPHNUM_QUALITE)


END PROGRAM essai
----------------------------------------------------------------------------------

With version 6.1-2, I get :
PGF90-S-0091-Constant expression of wrong data type (essai.F90: 9)
PGF90-S-0091-Constant expression of wrong data type (essai.F90: 9)
0 inform, 0 warnings, 2 severes, 0 fatal for essai

And nothing with v.6.0. Is it a bug or I need to add a compilation option or something else with the new version ???

Thanks, Pierre.
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Apr 21, 2006 9:50 am    Post subject: Reply with quote

Hi Pierre,

For some reason, the compiler isn't recognizing that "dble(PNB_EPHNUM_QUALITE)" is a constant expression. I've filed a technical problem report (TPR#3812) and will have one of our compiler engineers take a look.

The work around is to remove "dble" from the parameter. The compiler automatically promotes PNB_EPHNUM_QUALITE to a double for the calculation, so "dble" is not necessary. Below is the results using pgf90 6.0 using the original source versus pgf90 6.1 compiling source where I have removed "dble" from the parameter at line 9.
Code:
% pgf90 uf489_org.f90 -o uf489_60.out -V6.0
% pgf90 uf489_mod.f90 -o uf489_61.out -V6.1
% uf489_60.out
 Hello World
   2.2204460492503131E-014   2.2204460492503131E-014    0.000000000000000
% uf489_61.out
 Hello World
   2.2204460492503131E-014   2.2204460492503131E-014    0.000000000000000


Thank you for bring this to our attention,
Mat
Back to top
View user's profile
petrebang



Joined: 21 Apr 2006
Posts: 6

PostPosted: Mon Apr 24, 2006 12:37 am    Post subject: Reply with quote

Thanks !
Back to top
View user's profile
Catherine Moroney



Joined: 05 Jun 2006
Posts: 22

PostPosted: Mon Jun 05, 2006 2:50 pm    Post subject: constant expression of wrong data type Reply with quote

Hi,,

I'm getting the same PGF90-S-0091 error on the following bit
of code:

INTEGER*4, PARAMETER :: NCAMS
REAL, PARAMETER :: TLINE = 0.0408
INTEGER*4, PARAMETER, DIMENSION(NCAMS) :: DELTATL =
C (/ 0,1468,2760,
C 3887,5000,6113,
C 7240,8532,10000 /)
REAL, DIMENSION(NCAMS) :: DELTAT = DELTATL*TLINE

The error occurs on the last line of code, defining DELTAT.

I'm using V6.1 of the PGF90 compiler, with the -r4 and -i4
options.

Thanks,

Catherine
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Jun 06, 2006 1:49 pm    Post subject: Reply with quote

Hi Catherine,

Thank you for the report. This appears to be a different bug than the one Pierre reported so I've sent a report to our compiler team and issued a techincal problem report (TPR#3854). As a work around, you can intialize DELTAT using an array constructor. For example:
Code:
REAL, DIMENSION(NCAMS) :: DELTAT  = (/ (DELTATL(I) * TLINE, I = 1,NCAMS) /)


- Mat
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