aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index c7d3e54..9b2e565 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -4280,9 +4280,13 @@ component_initializer (gfc_typespec *ts, gfc_component *c, bool generate)
{
gfc_expr *init = NULL;
- /* See if we can find the initializer immediately. */
+ /* See if we can find the initializer immediately.
+ Some components should never get initializers. */
if (c->initializer || !generate
- || (ts->type == BT_CLASS && !c->attr.allocatable))
+ || (ts->type == BT_CLASS && !c->attr.allocatable)
+ || c->attr.pointer
+ || c->attr.class_pointer
+ || c->attr.proc_pointer)
return c->initializer;
/* Recursively handle derived type components. */