]> gcc.gnu.org Git - gcc.git/commitdiff
re PR fortran/41800 ([OOP] ICE in fold_convert_loc, at fold-const.c:2789)
authorJanus Weil <janus@gcc.gnu.org>
Fri, 23 Oct 2009 16:10:08 +0000 (18:10 +0200)
committerJanus Weil <janus@gcc.gnu.org>
Fri, 23 Oct 2009 16:10:08 +0000 (18:10 +0200)
2009-10-23  Janus Weil  <janus@gcc.gnu.org>

PR fortran/41800
* trans-expr.c (gfc_trans_scalar_assign): Handle CLASS variables.

2009-10-23  Janus Weil  <janus@gcc.gnu.org>

PR fortran/41800
* gfortran.dg/class_10.f03: New test.

From-SVN: r153504

gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/class_10.f03 [new file with mode: 0644]

index 0668a68305cc9dcef95251c87cfb26b56ee4a22e..bc4ecb03d3e4e01f76465e7cafda55d713c4ae79 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-23  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/41800
+       * trans-expr.c (gfc_trans_scalar_assign): Handle CLASS variables.
+
 2009-10-23  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/41758
index dc58dbf943da8c131d51b6b89a091495d9fa1057..da442edba4be1a27265abe1acae88f576598cdf2 100644 (file)
@@ -4660,7 +4660,7 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts,
          gfc_add_expr_to_block (&block, tmp);
        }
     }
-  else if (ts.type == BT_DERIVED)
+  else if (ts.type == BT_DERIVED || ts.type == BT_CLASS)
     {
       gfc_add_block_to_block (&block, &lse->pre);
       gfc_add_block_to_block (&block, &rse->pre);
index 03d21650a0d9e8d25fba87dd5336cb12c9733640..0fdbc541331c65e3ae129617889baf9e36c69e25 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-23  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/41800
+       * gfortran.dg/class_10.f03: New test.
+
 2009-10-22  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        PR target/41787
diff --git a/gcc/testsuite/gfortran.dg/class_10.f03 b/gcc/testsuite/gfortran.dg/class_10.f03
new file mode 100644 (file)
index 0000000..f238a59
--- /dev/null
@@ -0,0 +1,32 @@
+! { dg-do compile }
+!
+! PR 41800: [OOP] ICE in fold_convert_loc, at fold-const.c:2789
+!
+! Contributed by Harald Anlauf <anlauf@gmx.de>
+
+module abstract_gradient
+
+  implicit none
+  private
+
+  type, public, abstract :: gradient_class
+  contains
+    procedure, nopass  :: inner_product
+  end type
+
+contains
+
+  function inner_product ()
+    class(gradient_class), pointer :: inner_product
+    inner_product => NULL()
+  end function
+
+end module
+
+
+ use abstract_gradient
+ class(gradient_class), pointer    :: g_initial, ip_save
+ ip_save => g_initial%inner_product()   ! ICE
+end
+
+! { dg-final { cleanup-modules "abstract_gradient" } }
This page took 0.095192 seconds and 5 git commands to generate.