summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f90
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f90
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f90')
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f9059
1 files changed, 59 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f90
new file mode 100644
index 000000000..952285063
--- /dev/null
+++ b/gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f90
@@ -0,0 +1,59 @@
+! ICE with gfortran 4.5 at -O1:
+!gfcbug98.f90: In function ‘convert_cof’:
+!gfcbug98.f90:36:0: internal compiler error: in pt_solutions_same_restrict_base,
+!at tree-ssa-structalias.c:5072
+module foo
+ implicit none
+ type t_time
+ integer :: secs = 0
+ end type t_time
+contains
+ elemental function time_cyyyymmddhh (cyyyymmddhh) result (time)
+ type (t_time) :: time
+ character(len=10),intent(in) :: cyyyymmddhh
+ end function time_cyyyymmddhh
+
+ function nf90_open(path, mode, ncid)
+ character(len = *), intent(in) :: path
+ integer, intent(in) :: mode
+ integer, intent(out) :: ncid
+ integer :: nf90_open
+ end function nf90_open
+end module foo
+!==============================================================================
+module gfcbug98
+ use foo
+ implicit none
+
+ type t_fileinfo
+ character(len=10) :: atime = ' '
+ end type t_fileinfo
+
+ type t_body
+ real :: bg(10)
+ end type t_body
+contains
+ subroutine convert_cof (ifile)
+ character(len=*) ,intent(in) :: ifile
+
+ character(len=5) :: version
+ type(t_fileinfo) :: gattr
+ type(t_time) :: atime
+ type(t_body),allocatable :: tmp_dat(:)
+ real ,allocatable :: BDA(:, :, :)
+
+ call open_input
+ call convert_data
+ contains
+ subroutine open_input
+ integer :: i,j
+ version = ''
+ j = nf90_open(ifile, 1, i)
+ end subroutine open_input
+ !--------------------------------------------------------------------------
+ subroutine convert_data
+ BDA(1,:,1) = tmp_dat(1)% bg(:)
+ atime = time_cyyyymmddhh (gattr% atime)
+ end subroutine convert_data
+ end subroutine convert_cof
+end module gfcbug98