aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-02-13 14:04:56 +0100
committerMartin Liska <marxin@gcc.gnu.org>2019-02-13 13:04:56 +0000
commit53fcf729090af5a8269e363f3d737f023a17cf35 (patch)
tree8b91d10643513fdf41960b57408dabc6d0451862 /gcc/fortran/resolve.c
parent548538ce07ce78151dbaf2efdf48bb514794b915 (diff)
downloadgcc-53fcf729090af5a8269e363f3d737f023a17cf35.zip
gcc-53fcf729090af5a8269e363f3d737f023a17cf35.tar.gz
gcc-53fcf729090af5a8269e363f3d737f023a17cf35.tar.bz2
Fix -fdec simplification (PR fortran/88649).
2019-02-13 Martin Liska <mliska@suse.cz> 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
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 3a8f402..e215fef 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)
{