From 86eb9e2fbeb5541af8ac0ce37fa60cded76877b4 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 2 Sep 2014 16:08:05 +0000 Subject: [PATCH] re PR fortran/62270 (-Wlogical-not-parentheses warnings) PR fortran/62270 * interface.c (compare_parameter): Fix condition. * trans-expr.c (gfc_conv_procedure_call): Likewise. * gfortran.dg/pointer_intent_7.f90: Adjust dg-error. From-SVN: r214827 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/interface.c | 2 +- gcc/fortran/trans-expr.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/pointer_intent_7.f90 | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index eab86ed371b..518923baa5f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2014-09-02 Marek Polacek + + PR fortran/62270 + * interface.c (compare_parameter): Fix condition. + * trans-expr.c (gfc_conv_procedure_call): Likewise. + 2014-08-31 Fritz Reese PR fortran/62309 diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index b210d18256d..f6233b77b37 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -2014,7 +2014,7 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual, if (formal->ts.type == BT_CLASS && formal->attr.class_ok && actual->expr_type != EXPR_NULL && ((CLASS_DATA (formal)->attr.class_pointer - && !formal->attr.intent == INTENT_IN) + && formal->attr.intent != INTENT_IN) || CLASS_DATA (formal)->attr.allocatable)) { if (actual->ts.type != BT_CLASS) diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index f2ed47467cd..4c057eea10d 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -4589,7 +4589,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, && e->expr_type == EXPR_VARIABLE && (!e->ref || (e->ref->type == REF_ARRAY - && !e->ref->u.ar.type != AR_FULL)) + && e->ref->u.ar.type != AR_FULL)) && e->symtree->n.sym->attr.optional) { tmp = fold_build3_loc (input_location, COND_EXPR, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 97e73f83672..fa8fb470d66 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-09-02 Marek Polacek + + PR fortran/62270 + * gfortran.dg/pointer_intent_7.f90: Adjust dg-error. + 2014-09-02 Kyrylo Tkachov PR target/62275 diff --git a/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 b/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 index c09eb2b5ffa..5387ace8c19 100644 --- a/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 +++ b/gcc/testsuite/gfortran.dg/pointer_intent_7.f90 @@ -23,7 +23,7 @@ contains call bar2 (c) call bar3 (c) call bar2p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" } - call bar3p (b) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" } + call bar3p (b) ! { dg-error "Actual argument to .n. at \\(1\\) must be polymorphic" } call bar2p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" } call bar3p (c) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" } end subroutine -- 2.30.2