From 53fcf729090af5a8269e363f3d737f023a17cf35 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 13 Feb 2019 14:04:56 +0100 Subject: [PATCH] Fix -fdec simplification (PR fortran/88649). 2019-02-13 Martin Liska PR fortran/88649 * resolve.c (resolve_operator): Initialize 't' right after function entry. Skip switch (e->value.op.op) for -fdec operands that become function calls. From-SVN: r268842 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/resolve.c | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1ca41dc9031..c573f77410c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2019-02-13 Martin Liska + + PR fortran/88649 + * resolve.c (resolve_operator): Initialize 't' right + after function entry. Skip switch (e->value.op.op) + for -fdec operands that become function calls. + 2019-02-10 Thomas Koenig PR fortran/71723 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 3a8f4022df1..e215fef2be5 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -3880,7 +3880,7 @@ resolve_operator (gfc_expr *e) gfc_expr *op1, *op2; char msg[200]; bool dual_locus_error; - bool t; + bool t = true; /* Resolve all subnodes-- give them types. */ @@ -4002,7 +4002,7 @@ resolve_operator (gfc_expr *e) if (op2->ts.type != e->ts.type || op2->ts.kind != e->ts.kind) gfc_convert_type (op2, &e->ts, 1); e = logical_to_bitwise (e); - break; + goto simplify_op; } sprintf (msg, _("Operands of logical operator %%<%s%%> at %%L are %s/%s"), @@ -4018,7 +4018,7 @@ resolve_operator (gfc_expr *e) e->ts.type = BT_INTEGER; e->ts.kind = op1->ts.kind; e = logical_to_bitwise (e); - break; + goto simplify_op; } if (op1->ts.type == BT_LOGICAL) @@ -4143,8 +4143,6 @@ resolve_operator (gfc_expr *e) /* Deal with arrayness of an operand through an operator. */ - t = true; - switch (e->value.op.op) { case INTRINSIC_PLUS: @@ -4234,6 +4232,8 @@ resolve_operator (gfc_expr *e) break; } +simplify_op: + /* Attempt to simplify the expression. */ if (t) { -- 2.30.2