OSDN Git Service

2012-01-31 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jan 2012 18:38:43 +0000 (18:38 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jan 2012 18:38:43 +0000 (18:38 +0000)
        PR fortran/52029
        * class.c (gfc_find_derived_vtab): Mark _copy function as pure.

2012-01-31  Tobias Burnus  <burnus@net-b.de>

        PR fortran/52029
        * gfortran.dg/class_49.f90: New.

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

gcc/fortran/ChangeLog
gcc/fortran/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/class_49.f90 [new file with mode: 0644]

index b39e037..a0397cc 100644 (file)
@@ -1,5 +1,10 @@
 2012-01-31  Tobias Burnus  <burnus@net-b.de>
 
+       PR fortran/52029
+       * class.c (gfc_find_derived_vtab): Mark _copy function as pure.
+
+2012-01-31  Tobias Burnus  <burnus@net-b.de>
+
        PR fortran/52013
        * class.c (get_unique_hashed_string): Adapt trim length.
        (gfc_build_class_symbol) Encode also corank in the container name.
index 3ff6a0b..0d47979 100644 (file)
@@ -717,6 +717,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
                  sub_ns->proc_name = copy;
                  copy->attr.flavor = FL_PROCEDURE;
                  copy->attr.subroutine = 1;
+                 copy->attr.pure = 1;
                  copy->attr.if_source = IFSRC_DECL;
                  /* This is elemental so that arrays are automatically
                     treated correctly by the scalarizer.  */
index 3e0ca1e..8eb797e 100644 (file)
@@ -1,5 +1,10 @@
 2012-01-31  Tobias Burnus  <burnus@net-b.de>
 
+       PR fortran/52029
+       * gfortran.dg/class_49.f90: New.
+
+2012-01-31  Tobias Burnus  <burnus@net-b.de>
+
        PR fortran/52013
        * gfortran.dg/elemental_args_check_6.f90: New.
 
diff --git a/gcc/testsuite/gfortran.dg/class_49.f90 b/gcc/testsuite/gfortran.dg/class_49.f90
new file mode 100644 (file)
index 0000000..0c0b2b8
--- /dev/null
@@ -0,0 +1,11 @@
+! { dg-do compile }
+!
+! PR fortran/52029
+!
+
+elemental subroutine foo()
+  type t
+  end type t
+  class(t), allocatable :: x
+  if (allocated(x)) i = 5
+end