diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2007-09-02 12:23:04 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2007-09-02 05:23:04 -0700 |
commit | 669141025a2d25735de6fdded6c4836fcff3feec (patch) | |
tree | 63bf9e707a079a0ef3f1c54b5d986476e3c1582b | |
parent | ead8827dd68112fe99b434d62614ab9aaec7f9de (diff) | |
download | gcc-669141025a2d25735de6fdded6c4836fcff3feec.zip gcc-669141025a2d25735de6fdded6c4836fcff3feec.tar.gz gcc-669141025a2d25735de6fdded6c4836fcff3feec.tar.bz2 |
re PR fortran/33276 (465.tonto in SPEC CPU 2006 fails to compile)
gcc/fortran/
2007-09-02 H.J. Lu <hongjiu.lu@intel.com>
PR fortran/33276
* array.c (expand_iterator): Initialize frame.prev.
gcc/testsuite/
2007-09-02 H.J. Lu <hongjiu.lu@intel.com>
PR fortran/33276
* gfortran.fortran-torture/compile/pr33276.f90: New.
From-SVN: r128024
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/array.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.fortran-torture/compile/pr33276.f90 | 27 |
4 files changed, 38 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9e8abea..00f798a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2007-09-02 H.J. Lu <hongjiu.lu@intel.com> + + PR fortran/33276 + * array.c (expand_iterator): Initialize frame.prev. + 2007-08-31 Tobias Burnus <burnus@net-b.de> PR fortran/33232 diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 149adfa..0c30b33 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -1281,6 +1281,7 @@ expand_iterator (gfc_constructor *c) mpz_init (trip); mpz_init (frame.value); + frame.prev = NULL; start = gfc_copy_expr (c->iterator->start); if (gfc_simplify_expr (start, 1) == FAILURE) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d2b7b7d..3efc896 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-09-02 H.J. Lu <hongjiu.lu@intel.com> + + PR fortran/33276 + * gfortran.fortran-torture/compile/pr33276.f90: New. + 2007-09-02 Joseph Myers <joseph@codesourcery.com> PR middle-end/33272 diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/pr33276.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/pr33276.f90 new file mode 100644 index 0000000..0eaac1a --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/compile/pr33276.f90 @@ -0,0 +1,27 @@ +! PR fortran/33276 +! this used to crash due to an uninitialized variable in expand_iterator. + +module foo + type buffer_type + integer(kind=kind(1)) :: item_end + character(256) :: string + end type + type textfile_type + type(buffer_type) :: buffer + end type +contains + function rest_of_line(self) result(res) + type(textfile_type) :: self + intent(inout) :: self + character(128) :: res + res = self%buffer%string(self%buffer%item_end+1: ) + end function + + subroutine read_intvec_ptr(v) + integer(kind=kind(1)), dimension(:), pointer :: v + integer(kind=kind(1)) :: dim,f,l,i + + if (dim>0) then; v = (/ (i, i=f,l) /) + end if + end subroutine +end |