OSDN Git Service

2008-08-29 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Aug 2008 11:47:01 +0000 (11:47 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Aug 2008 11:47:01 +0000 (11:47 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139765 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.fortran-torture/compile/20080806-1.f90 [new file with mode: 0644]
gcc/tree-ssa-structalias.c

index 1321645..441ce2b 100644 (file)
@@ -1,5 +1,12 @@
 2008-08-29  Richard Guenther  <rguenther@suse.de>
 
+       * 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  <rguenther@suse.de>
+
        * common.opt (ftree-store-ccp): Mark as preserved for
        backward compatibility.
        * doc/invoke.texi (-ftree-store-ccp): Remove documentation.
index d336719..08ea1d3 100644 (file)
@@ -1,5 +1,9 @@
 2008-08-29  Richard Guenther  <rguenther@suse.de>
 
+       * gfortran.fortran-torture/compile/20080805-1.f90: New testcase.
+
+2008-08-29  Richard Guenther  <rguenther@suse.de>
+
        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 (file)
index 0000000..3abc80a
--- /dev/null
@@ -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
index db0912a..6db8298 100644 (file)
@@ -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