Le 06/08/2015 12:53, Andre Vehreschild a écrit :
Dear all,

the attached patch fixes a regression introduced by my patches for the
F2008-style allocate(). In this case a function returning an array of BT_CLASS
objects can not be conv'ed using conv_expr_descriptor, but needs to be
conv_expr_reference()'ed, because the _data component has the descriptor already
and just needs to be addressed correctly.

Bootstraps and regtests ok on x86_64-linux-gnu/f21.

Ok for trunk?

Regards,
        Andre

pr66927_1.patch

diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 6409f7f..3f90b76 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -5187,9 +5187,14 @@ gfc_trans_allocate (gfc_code * code)
          /* In all other cases evaluate the expr3.  */
          symbol_attribute attr;
          /* Get the descriptor for all arrays, that are not allocatable or
-            pointer, because the latter are descriptors already.  */
+            pointer, because the latter are descriptors already.
+            The exception are function calls returning a class object:
+            For those conv_expr_descriptor does not work.  */

So, it is gfc_conv_expr_descriptor that should be fixed?
Let me have a look at it.

Mikael

Reply via email to