Assumed length character implicit typing nonsense gives ICE

Assumed length character implicit typing nonsense gives ICE

Inspired by a current c.l.f thread, I thought I'd torture the compiler...

MODULE DontTryThisAtHomeKids
  IMPLICIT CHARACTER(*)(s)
CONTAINS
  CHARACTER(LEN(s)) FUNCTION reverse(s)
    FORALL (i=LEN(s):1:-1) reverse(i:i) = s(i:i)
  END FUNCTION reverse
END MODULE DontTryThisAtHomeKids

As per the thread, I've clearly got no idea whether this is valid source or not, but...

>ifort /c /check:all /warn:all /standard-semantics "2013-01-09 implicit.f90"
Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version 13.0.1.119 Build 20121008
Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.
2013-01-09 implicit.f90(4): warning #6717: This name has not been given an explicit type.   [S]
  CHARACTER(LEN(s)) FUNCTION reverse(s)
----------------^
2013-01-09 implicit.f90(5): warning #6717: This name has not been given an explicit type.   [I]
    FORALL (i=LEN(s):1:-1) reverse(i:i) = s(i:i)
------------^
2013-01-09 implicit.f90(1): catastrophic error: **Internal compiler error: internal abort** Please report this error alo
ng with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be expli
cit cause of this error.
compilation aborted for 2013-01-09 implicit.f90 (code 1)

5 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Sigh - thanks....

Steve - Intel Developer Support

/check:bounds is what triggers the ICE. Without that the code compiles and even executes. The code you have doesn't reverse the string, but this works:


MODULE DontTryThisAtHomeKids

  IMPLICIT CHARACTER(*)(s)

CONTAINS

  CHARACTER(LEN(s)) FUNCTION reverse(s)

    FORALL (i=LEN(s):1:-1) reverse(i:i) = s((len(s)-i+1):(len(s)-i+1))

  END FUNCTION reverse

END MODULE DontTryThisAtHomeKids
program test
use DontTryThisAtHomeKids
character(7) string
string = 'Reverse'

print *, reverse(string)

end

However, it seems the IMPLICIT is also implicated, as the following doesn't get an error:


MODULE DontTryThisAtHomeKids

  !IMPLICIT CHARACTER(*)(s)

CONTAINS

  FUNCTION reverse(s) result (r)

character(*) S

character(LEN(S)) R

    FORALL (i=LEN(s):1:-1) r(i:i) = s((len(s)-i+1):(len(s)-i+1))

  END FUNCTION reverse

END MODULE DontTryThisAtHomeKids

Escalated as DPD200239962.

Steve - Intel Developer Support

And for what it's worth, this usage is legal as best as I can tell.

Steve - Intel Developer Support

This problem has been fixed for a release later this year.

Steve - Intel Developer Support

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi