aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2012-01-02 12:46:08 +0000
committerPaul Thomas <pault@gcc.gnu.org>2012-01-02 12:46:08 +0000
commit94fae14bf8aa693c31a8d19febfffd048edb9535 (patch)
tree53e0449d8730adad6792cd4d30c5897584d9c6c1 /gcc/fortran/interface.c
parent9ecd3a64a9a6d63bd108f2927c611fabff84745d (diff)
downloadgcc-94fae14bf8aa693c31a8d19febfffd048edb9535.zip
gcc-94fae14bf8aa693c31a8d19febfffd048edb9535.tar.gz
gcc-94fae14bf8aa693c31a8d19febfffd048edb9535.tar.bz2
re PR fortran/51529 ([OOP] gfortran.dg/class_to_type_1.f03 is miscompiled: Uninitialized variable used)
2012-01-02 Paul Thomas <pault@gcc.gnu.org> PR fortran/51529 * trans-array.c (gfc_array_allocate): Null allocated memory of newly allocted class arrays. PR fortran/46262 PR fortran/46328 PR fortran/51052 * interface.c(build_compcall_for_operator): Add a type to the expression. * trans-expr.c (conv_base_obj_fcn_val): New function. (gfc_conv_procedure_call): Use base_expr to detect non-variable base objects and, ensuring that there is a temporary variable, build up the typebound call using conv_base_obj_fcn_val. (gfc_trans_class_assign): Pick out class procedure pointer assignments and do the assignment with no further prcessing. (gfc_trans_class_array_init_assign, gfc_trans_class_init_assign gfc_trans_class_assign): Move to top of file. * gfortran.h : Add 'base_expr' field to gfc_expr. * resolve.c (get_declared_from_expr): Add 'types' argument to switch checking of derived types on or off. (resolve_typebound_generic_call): Set the new argument. (resolve_typebound_function, resolve_typebound_subroutine): Set 'types' argument for get_declared_from_expr appropriately. Identify base expression, if not a variable, in the argument list of class valued calls. Assign it to the 'base_expr' field of the final expression. Strip away all references after the last class reference. 2012-01-02 Paul Thomas <pault@gcc.gnu.org> PR fortran/46262 PR fortran/46328 PR fortran/51052 * gfortran.dg/typebound_operator_7.f03: New. * gfortran.dg/typebound_operator_8.f03: New. From-SVN: r182796
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index e914c6c..773749d 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1,6 +1,6 @@
/* Deal with interfaces.
Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010
+ 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Andy Vaught
@@ -3256,6 +3256,14 @@ build_compcall_for_operator (gfc_expr* e, gfc_actual_arglist* actual,
e->value.compcall.base_object = base;
e->value.compcall.ignore_pass = 1;
e->value.compcall.assign = 0;
+ if (e->ts.type == BT_UNKNOWN
+ && target->function)
+ {
+ if (target->is_generic)
+ e->ts = target->u.generic->specific->u.specific->n.sym->ts;
+ else
+ e->ts = target->u.specific->n.sym->ts;
+ }
}