- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I obtain an "Internal compiler error" when I try to write to screen the result of a deferred-length character function, directly appened to another character string.
The compiler is :
Intel Visual Fortran Compiler XE version 12.0 Update 4 for Windows (Package ID: w_fcompxe_2011.4.196)
The code is :
The command-line is :
ifort test_dlc.f90
The error message is :
Intel Visual Fortran Compiler XE for applications running on IA-32, Version 12.0 Build 20110427
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
test_dlc.f90
0_1855
D:\\utilit\\Fortran\\sources\\DIVERS\\test_dlc.f90(19): catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.
compilation aborted for D:\\utilit\\Fortran\\sources\\DIVERS\\test_dlc.f90 (code 1)
For information, I don't have this problem with ifort 11.1.070
I obtain an "Internal compiler error" when I try to write to screen the result of a deferred-length character function, directly appened to another character string.
The compiler is :
Intel Visual Fortran Compiler XE version 12.0 Update 4 for Windows (Package ID: w_fcompxe_2011.4.196)
The code is :
[fortran]!============================================================================================================= program test_dlc !============================================================================================================= implicit none character(len=:), allocatable :: txt interface Function Test(str1) character(len=:),allocatable :: Test character(len=*),intent(in) :: str1 end Function end interface txt ='hello' write(*,*) txt write(*,*) Test(txt) ! This line is OK write(*,*) Test(txt)//' world' ! This line causes the compiler crash in version 12.0.4.196 !!! end program test_dlc !============================================================================================================= Function Test(str1) ! deferred-length character function !============================================================================================================= implicit none character(len=:),allocatable :: Test ! deferred-length character character(len=*),intent(in) :: str1 Test=str1 end Function Test [/fortran]
The command-line is :
ifort test_dlc.f90
The error message is :
Intel Visual Fortran Compiler XE for applications running on IA-32, Version 12.0 Build 20110427
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
test_dlc.f90
0_1855
D:\\utilit\\Fortran\\sources\\DIVERS\\test_dlc.f90(19): catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.
compilation aborted for D:\\utilit\\Fortran\\sources\\DIVERS\\test_dlc.f90 (code 1)
For information, I don't have this problem with ifort 11.1.070
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had a similar problem with gfortran. When I did this to it, it worked okay:
!=============================================================================================================
program test_dlc
!=============================================================================================================
implicit none
character(len=:), allocatable :: txt
txt ='hello'
write(*,*) txt
write(*,*) Test(txt) ! This line is OK
write(*,*) Test(txt)//' world' ! This line causes the compiler crash in version 12.0.4.196 !!!
contains
!=============================================================================================================
Function Test(str1) ! deferred-length character function
!=============================================================================================================
implicit none
character(len=:),allocatable :: Test ! deferred-length character
character(len=*),intent(in) :: str1
Test=str1
end Function Test
end program test_dlc
!=============================================================================================================
program test_dlc
!=============================================================================================================
implicit none
character(len=:), allocatable :: txt
txt ='hello'
write(*,*) txt
write(*,*) Test(txt) ! This line is OK
write(*,*) Test(txt)//' world' ! This line causes the compiler crash in version 12.0.4.196 !!!
contains
!=============================================================================================================
Function Test(str1) ! deferred-length character function
!=============================================================================================================
implicit none
character(len=:),allocatable :: Test ! deferred-length character
character(len=*),intent(in) :: str1
Test=str1
end Function Test
end program test_dlc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - we'll take a look.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@lklawrie
Your solution (with contains) doesn't work with IF 12.0.4.196 :-(
I have also tried to put this function into a separate Module => Internal error !
@all
But the 2 following lines are OK :
and
Your solution (with contains) doesn't work with IF 12.0.4.196 :-(
I have also tried to put this function into a separate Module => Internal error !
@all
But the 2 following lines are OK :
[fortran]write(*,*) trim(Test(txt))//' world'[/fortran]
and
[fortran]character(len=:), allocatable :: txt2 ... txt2=Test(txt) ; write(*,*) txt2//' world'[/fortran]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - I have escalated this as issue DPD200170710. It is the concatenation of the function result that triggers the problem - it does not matter how you declare the function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has been fixed for a future release. The workaround is to assign the function value to a local variable and use the variable in the concatenation.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page