------- Comment #4 from dfranke at gcc dot gnu dot org  2010-05-18 21:54 -------
Comment #3 is somewhat hard to parse. Once more with this reduced testcase:

  TYPE :: ptype
    character, pointer, dimension(:) :: x => null()
  END TYPE
  TYPE(ptype) :: p
  print *, (p)        ! '()' are significant
end

Breakpoint 9, resolve_transfer (code=0x8bfed90) at
/home/daniel/svn/gcc-svn/gcc/fortran/resolve.c:7369
7369      if (exp->expr_type != EXPR_VARIABLE && exp->expr_type !=
EXPR_FUNCTION)
(gdb) list
7367      exp = code->expr1;
7368
7369      if (exp->expr_type != EXPR_VARIABLE && exp->expr_type !=
EXPR_FUNCTION)
7370        return;
7371
(gdb) p exp->expr_type
$11 = EXPR_OP
(gdb) p exp->ts.u.derived->name
$12 = 0xb7f47a08 "ptype"
(gdb) p exp->value.op
$13 = {op = INTRINSIC_PARENTHESES, uop = 0x0, op1 = 0x8bb1450, op2 = 0x0}
(gdb) p exp->value.op.op1->expr_type
$14 = EXPR_VARIABLE
(gdb) p exp->value.op.op1->ts.u.derived->name
$15 = 0xb7f47a08 "ptype"

No idea how to fix this, adding the obvious check and workaround for EXPR_OP
feels wrong. More likely, EXPR_OP should never have been passed down here?!


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41859

Reply via email to