This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] Fix PR 15211
Tobias Schlüter wrote:
Below is what I committed after testing. I also added a check for this
to execute/intrinsic_len.f90.
If (as I think) && has a higher precedence than ||, my previous patch
was wrong, so I committed this, which adds parentheses and readability
to the expression.
- Tobi
Index: trans-intrinsic.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-intrinsic.c,v
retrieving revision 1.7
diff -u -p -r1.7 trans-intrinsic.c
--- trans-intrinsic.c 14 Jun 2004 18:50:42 -0000 1.7
+++ trans-intrinsic.c 14 Jun 2004 19:16:39 -0000
@@ -1874,8 +1874,9 @@ gfc_conv_intrinsic_len (gfc_se * se, gfc
break;
default:
- if (arg->expr_type == EXPR_VARIABLE && arg->ref == NULL
- || (arg->ref->next == NULL && arg->ref->type == REF_ARRAY))
+ if (arg->expr_type == EXPR_VARIABLE
+ && (arg->ref == NULL || (arg->ref->next == NULL
+ && arg->ref->type == REF_ARRAY)))
{
/* This doesn't catch all cases.
See http://gcc.gnu.org/ml/fortran/2004-06/msg00165.html