[Bug fortran/25072] better diagnostic needed

fxcoudert at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Nov 26 19:53:00 GMT 2005



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2005-11-26 19:53 -------
gfortran doesn't issue a correct error, and throw an ICE instead:

 In file foo.f90:2

FORALL(I=1:10,T(I)) A(I)=I
              1
 Internal Error at (1):
 free_expr0(): Bad expr type
## g95 ##
In file foo.f90:2

FORALL(I=1:10,T(I)) A(I)=I
               1
Error: Function reference to 't' in FORALL mask at (1) is to a non-PURE
procedure
## Intel ##
fortcom: Error: foo.f90, line 2: Any function referenced in a forall-body-stmt
must have the PURE attribute explicitly declared.   [T]
FORALL(I=1:10,T(I)) A(I)=I
--------------^
compilation aborted for foo.f90 (code 1)
## Portland ##
PGF90-F-0155-t - FORALL requires PURE function interface (foo.f90: 2)
PGF90/any Linux/x86 5.2-4: compilation aborted
## Sun ##

FORALL(I=1:10,T(I)) A(I)=I
              ^
"foo.f90", Line = 2, Column = 15: ERROR: Procedure T is referenced within a
scalar-mask-expression. It must be a PURE procedure.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-invalid-code
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-26 19:53:06
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25072



More information about the Gcc-bugs mailing list