diff options
author | Richard Guenther <rguenther@suse.de> | 2010-01-18 09:57:11 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-01-18 09:57:11 +0000 |
commit | 1cfd38bea344c2742a057f23ee636c9d1ccd5bb8 (patch) | |
tree | 263e2efcdc0579dc1cab4be734a4ef34e7d77d56 | |
parent | f7746c594182ce282072b665567d2eb6a7589151 (diff) | |
download | gcc-1cfd38bea344c2742a057f23ee636c9d1ccd5bb8.zip gcc-1cfd38bea344c2742a057f23ee636c9d1ccd5bb8.tar.gz gcc-1cfd38bea344c2742a057f23ee636c9d1ccd5bb8.tar.bz2 |
re PR tree-optimization/42781 (ICE in pt_solutions_same_restrict_base, at tree-ssa-structalias.c:5072)
2010-01-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42781
* tree-ssa-structalias.c (find_what_var_points_to): Skip
restrict processing only if the original variable was
artificial.
* gfortran.fortran-torture/compile/pr42781.f90: New testcase.
From-SVN: r156006
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f90 | 59 | ||||
-rw-r--r-- | gcc/tree-ssa-structalias.c | 7 |
4 files changed, 75 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c839a8..2ad9c06 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-01-18 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/42781 + * tree-ssa-structalias.c (find_what_var_points_to): Skip + restrict processing only if the original variable was + artificial. + 2010-01-18 Joern Rennecke <amylaar@spamcop.net> * doc/tm.texi (TARGET_ASM_FUNCTION_EPILOGUE): Update text on where to diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f494a09..dabbca1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-01-18 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/42781 + * gfortran.fortran-torture/compile/pr42781.f90: New testcase. + 2010-01-17 Richard Guenther <rguenther@suse.de> PR middle-end/42248 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 0000000..9522850 --- /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 diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 753eefe..3db2874 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -4776,18 +4776,19 @@ set_uids_in_ptset (bitmap into, bitmap from, struct pt_solution *pt) /* Compute the points-to solution *PT for the variable VI. */ static void -find_what_var_points_to (varinfo_t vi, struct pt_solution *pt) +find_what_var_points_to (varinfo_t orig_vi, struct pt_solution *pt) { unsigned int i; bitmap_iterator bi; bitmap finished_solution; bitmap result; + varinfo_t vi; memset (pt, 0, sizeof (struct pt_solution)); /* This variable may have been collapsed, let's get the real variable. */ - vi = get_varinfo (find (vi->id)); + vi = get_varinfo (find (orig_vi->id)); /* Translate artificial variables into SSA_NAME_PTR_INFO attributes. */ @@ -4822,7 +4823,7 @@ find_what_var_points_to (varinfo_t vi, struct pt_solution *pt) /* Instead of doing extra work, simply do not create elaborate points-to information for pt_anything pointers. */ if (pt->anything - && (vi->is_artificial_var + && (orig_vi->is_artificial_var || !pt->vars_contains_restrict)) return; |