This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] PR41859 ICE on invalid expression involving DT with pointer components in I/O
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Jerry DeLisle <jvdelisle at verizon dot net>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Aug 2010 07:58:13 +0200
- Subject: Re: [patch, fortran] PR41859 ICE on invalid expression involving DT with pointer components in I/O
- References: <4C69F243.4090001@verizon.net>
Dear Jerry,
> OK for trunk?
OK but for one tiny question:
Should you not check for parentheses, just to stop the code trying to
charge down, for example, binary operators? Since expr1 has been
resolved already at the top of resolve_code, this should not matter -
it's just unnecessary.
eg.
Index: resolve.c
===================================================================
--- resolve.c (revision 163259)
+++ resolve.c (working copy)
@@ -7696,7 +7696,11 @@ resolve_transfer (gfc_code *code)
exp = code->expr1;
- if (exp->expr_type != EXPR_VARIABLE && exp->expr_type != EXPR_FUNCTION)
+ while (exp != NULL && exp->expr_type == EXPR_OP && exp->value.op.op
== INTRINSIC_PARENTHESES)
+ exp = exp->value.op.op1;
+
+ if (exp == NULL || (exp->expr_type != EXPR_VARIABLE
+ && exp->expr_type != EXPR_FUNCTION))
return;
Thanks for the patch!
Paul
sym = exp->symtree->n.sym;