[Bug fortran/41872] wrong-code: Issues with allocatable scalars
burnus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Dec 30 20:50:00 GMT 2009
------- Comment #8 from burnus at gcc dot gnu dot org 2009-12-30 20:50 -------
TODO:
> - SAVED local variables are (probably) mishandled
> - Check whether other things such as allocatable scalar components,
> (absent/present) optional dummys etc. work.
- allocatable-scalar returning functions as actual argument
- character-returning actual arguments
Check whether the following patch is needed or nonsense:
--- gcc/fortran/trans-expr.c (Revision 155510)
+++ gcc/fortran/trans-expr.c
@@ -1905,7 +1905,7 @@ gfc_add_interface_mapping (gfc_interface
{
tmp = gfc_get_character_type_len (sym->ts.kind, NULL);
tmp = build_pointer_type (tmp);
- if (sym->attr.pointer)
+ if (sym->attr.pointer || sym->attr.allocatable)
value = build_fold_indirect_ref_loc (input_location,
se->expr);
else
@@ -4478,10 +4479,12 @@ gfc_conv_expr_reference (gfc_se * se, gf
if (expr->expr_type == EXPR_FUNCTION
&& ((expr->value.function.esym
- && expr->value.function.esym->result->attr.pointer
+ && (expr->value.function.esym->result->attr.pointer
+ || expr->value.function.esym->result->attr.allocatable)
&& !expr->value.function.esym->result->attr.dimension)
|| (!expr->value.function.esym
- && expr->symtree->n.sym->attr.pointer
+ && (expr->symtree->n.sym->attr.pointer
+ || expr->symtree->n.sym->attr.allocatable)
&& !expr->symtree->n.sym->attr.dimension)))
{
se->want_pointer = 1;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41872
More information about the Gcc-bugs
mailing list