From 13c6bff447cc89b20e6e139b96dfd866fede5644 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 29 Aug 2008 11:47:01 +0000 Subject: [PATCH] tree-ssa-structalias.c (create_variable_info_for): Do not create fields for heap vars or vars with a noalias state. 2008-08-29 Richard Guenther * tree-ssa-structalias.c (create_variable_info_for): Do not create fields for heap vars or vars with a noalias state. For NO_ALIAS_ANYTHING variables add a self-constraint, not one from ESCAPED. * gfortran.fortran-torture/compile/20080806-1.f90: New testcase. From-SVN: r139765 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 4 ++++ .../compile/20080806-1.f90 | 24 ++++++++++++++++++++++ gcc/tree-ssa-structalias.c | 14 +++++++++++-- 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gfortran.fortran-torture/compile/20080806-1.f90 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1321645..441ce2b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2008-08-29 Richard Guenther + * tree-ssa-structalias.c (create_variable_info_for): Do not + create fields for heap vars or vars with a noalias state. + For NO_ALIAS_ANYTHING variables add a self-constraint, not one + from ESCAPED. + +2008-08-29 Richard Guenther + * common.opt (ftree-store-ccp): Mark as preserved for backward compatibility. * doc/invoke.texi (-ftree-store-ccp): Remove documentation. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d336719..08ea1d3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2008-08-29 Richard Guenther + * gfortran.fortran-torture/compile/20080805-1.f90: New testcase. + +2008-08-29 Richard Guenther + PR middle-end/37236 * gfortran.fortran-torture/compile/pr37236.f: New testcase. diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/20080806-1.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/20080806-1.f90 new file mode 100644 index 0000000..3abc80a --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/compile/20080806-1.f90 @@ -0,0 +1,24 @@ +MODULE M1 + IMPLICIT NONE + TYPE mmm + COMPLEX(KIND=8), DIMENSION(:,:), POINTER :: data + END TYPE mmm + +CONTAINS + + SUBROUTINE S(ma,mb,mc) + TYPE(mmm), POINTER :: ma,mb,mc + COMPLEX(KIND=8), DIMENSION(:, :), & + POINTER :: a, b, c + INTEGER :: i,j + a=>ma%data + b=>mb%data + c=>mc%data + DO i=1,size(a,1) + DO j=1,size(a,2) + c(i,j)=a(i,j)*b(i,j) + ENDDO + ENDDO + END SUBROUTINE + +END MODULE M1 diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index db0912a..6db8298 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -4354,7 +4354,11 @@ create_variable_info_for (tree decl, const char *name) if (TREE_CODE (decl) == FUNCTION_DECL && in_ipa_mode) return create_function_info_for (decl, name); - if (var_can_have_subvars (decl) && use_field_sensitive) + if (var_can_have_subvars (decl) && use_field_sensitive + && (!var_ann (decl) + || var_ann (decl)->noalias_state == 0) + && (!var_ann (decl) + || !var_ann (decl)->is_heapvar)) push_fields_onto_fieldstack (decl_type, &fieldstack, 0); /* If the variable doesn't have subvars, we may end up needing to @@ -4380,7 +4384,13 @@ create_variable_info_for (tree decl, const char *name) VEC_safe_push (varinfo_t, heap, varmap, vi); if (is_global && (!flag_whole_program || !in_ipa_mode) && could_have_pointers (decl)) - make_constraint_from (vi, escaped_id); + { + if (var_ann (decl) + && var_ann (decl)->noalias_state == NO_ALIAS_ANYTHING) + make_constraint_from (vi, vi->id); + else + make_constraint_from (vi, escaped_id); + } stats.total_vars++; if (use_field_sensitive -- 2.7.4