PGF90-S-0087-Non-constant expression where constant expression required 
Author Message
 PGF90-S-0087-Non-constant expression where constant expression required

I would like to pick up a topic again that was previously on this
newsgroup in January, 2005.  It concerns a compiler error in PGF90
version 5.1-2.

$ cat t.f90
MODULE t
implicit none
integer, parameter :: &
  t0(0:0) = (/0/), &
  t1(0:0) = t0(0:0)
END MODULE t

$ pgf90 -V t.f90
pgf90 5.1-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2003, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/any Linux/x86 5.1-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2003, STMicroelectronics, Inc.  All Rights Reserved.
PGF90-S-0087-Non-constant expression where constant expression required
(t.f90: 3)
  0 inform,   0 warnings,   1 severes, 0 fatal for t

The error message is triggered by the assignment
  t1(0:0) = t0(0:0)
if we replace it by
  t1(0:0) = t0
then the module is compiled fine.

Can anyone say if this error has been fixed in a more recent release
of the PGF90 compiler?

Bas Braams



Tue, 29 Jan 2008 04:32:27 GMT  
 PGF90-S-0087-Non-constant expression where constant expression required


Quote:

> Can anyone say if this error has been fixed in a more recent release
> of the PGF90 compiler?

I don't know, but...

Wouldn't it seem more obvious to ask PGI instead of the newsgroup?
I understand people asking on the newsgroup when they aren't sure
whether their code is valid or not, but that doesn't seem to be the
question here. This sounds like a straightforward vendor support
matter. Is PGI unresponsive or did you just not try them?

--
Richard Maine                       |  Good judgment comes from experience;
email: my first.last at org.domain  |  experience comes from bad judgment.
org: nasa, domain: gov              |        -- Mark Twain



Tue, 29 Jan 2008 04:46:04 GMT  
 PGF90-S-0087-Non-constant expression where constant expression required

Quote:

> I would like to pick up a topic again that was previously on this
> newsgroup in January, 2005.  It concerns a compiler error in PGF90
> version 5.1-2.

> $ cat t.f90
> MODULE t
> implicit none
> integer, parameter :: &
>   t0(0:0) = (/0/), &
>   t1(0:0) = t0(0:0)
> END MODULE t

> $ pgf90 -V t.f90
> pgf90 5.1-2
> Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
> Copyright 2000-2003, STMicroelectronics, Inc.  All Rights Reserved.
> PGF90/any Linux/x86 5.1-2
> Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
> Copyright 2000-2003, STMicroelectronics, Inc.  All Rights Reserved.
> PGF90-S-0087-Non-constant expression where constant expression required
> (t.f90: 3)
>   0 inform,   0 warnings,   1 severes, 0 fatal for t

> The error message is triggered by the assignment
>   t1(0:0) = t0(0:0)
> if we replace it by
>   t1(0:0) = t0
> then the module is compiled fine.

> Can anyone say if this error has been fixed in a more recent release
> of the PGF90 compiler?

The particular error message your mention was triggered by many different ways of specifying
initialisation expressions in parameter declarations. I first encountered it when I used ABS or SIGN
intrinsics in initialisation expressions. The problem with ABS() was fixed in v4 or v5, but the
problem with SIGN() wasn't fixed until v6. Since the same error had different causes and was fixed
at different times, the only reliable way to determine if v6 fixes the bug for your particular
situation is to check with PGI. You might want to register and log into their forum - it's a quick
way to get an answer if you don't want to fill out a support request.

Go to http://www.pgroup.com/userforum/index.php

I'd test your snippet myself, but I dropped my PGI license for a Lahey one (I couldn't wait anymore
for this particular problem to be fixed) and I'm just getting back into the "PGI fold", so to speak,
and haven't yet got a new PGI v6 license installed.

cheers,

paulv

--
Paul van Delst



Tue, 29 Jan 2008 05:28:42 GMT  
 PGF90-S-0087-Non-constant expression where constant expression required

Quote:

> I would like to pick up a topic again that was previously on this
> newsgroup in January, 2005.  It concerns a compiler error in PGF90
> version 5.1-2.

> $ cat t.f90
> MODULE t
> implicit none
> integer, parameter :: &
>   t0(0:0) = (/0/), &
>   t1(0:0) = t0(0:0)
> END MODULE t

> Can anyone say if this error has been fixed in a more recent release
> of the PGF90 compiler?

Yup, seems to work fine on 6.0. But as others said, if you find a bug
in the compiler, asking the vendor is probably more helpful than this
group. Of course, if the vendor refuses to fix the bug and it is a
violation of the standard, some knowledgeable persons around here can
probably provide you with an appropriate quotation from the standard
that you can use to beat the vendor with.

As for a personal anecdote, the one time I reported a bug to PGF
technical support, they IIRC responded within a few hours saying that
the bug doesn't occur in a newer compiler version (fair enough, IMHO),
so no complaints there on my part at least.

--
Janne Blomqvist



Tue, 29 Jan 2008 19:09:04 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. PGF90-S-0087-Non-constant expression where constant expression required

2. Non-constant expression where constant expression required.

3. Lint on a non-constant expression - harmful?

4. optimizing evaluation of constant expressions

5. constant expressions, parameters, `define

6. constant expressions, parameters, `define

7. '87 LRM - constant expression on port

8. Salford compiler: Assigning a value to a constant expression is invalid

9. constants (literal, parameter, expression) in F77

10. complex constants and expression syntax extension a la Mathematica

11. constant expressions & compilers

12. Constant expressions and mathematical functions

 

 
Powered by phpBB® Forum Software