]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-structalias.c (create_variable_info_for): Do not create fields for heap...
authorRichard Guenther <rguenther@suse.de>
Fri, 29 Aug 2008 11:47:01 +0000 (11:47 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 29 Aug 2008 11:47:01 +0000 (11:47 +0000)
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.

        * gfortran.fortran-torture/compile/20080806-1.f90: New testcase.

From-SVN: r139765

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 1321645e9e00447fb25b11983965ceda07bb521b..441ce2b0dc1af6767074257d9686200f81d06d99 100644 (file)
@@ -1,3 +1,10 @@
+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
index d33671917d55919179ee657f87bc6e117e41cb9b..08ea1d3a87015890bca095c45e109465368bc6e5 100644 (file)
@@ -1,3 +1,7 @@
+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
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 db0912abe8a283f225ee34f5c116c1da154317b7..6db829808d8d892f35708c0950c69d68e70da2fa 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