Commit 53fcf729 by Martin Liska Committed by Martin Liska

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
parent 548538ce
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.
2019-02-10 Thomas Koenig <tkoenig@gcc.gnu.org> 2019-02-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71723 PR fortran/71723
......
...@@ -3880,7 +3880,7 @@ resolve_operator (gfc_expr *e) ...@@ -3880,7 +3880,7 @@ resolve_operator (gfc_expr *e)
gfc_expr *op1, *op2; gfc_expr *op1, *op2;
char msg[200]; char msg[200];
bool dual_locus_error; bool dual_locus_error;
bool t; bool t = true;
/* Resolve all subnodes-- give them types. */ /* Resolve all subnodes-- give them types. */
...@@ -4002,7 +4002,7 @@ resolve_operator (gfc_expr *e) ...@@ -4002,7 +4002,7 @@ resolve_operator (gfc_expr *e)
if (op2->ts.type != e->ts.type || op2->ts.kind != e->ts.kind) if (op2->ts.type != e->ts.type || op2->ts.kind != e->ts.kind)
gfc_convert_type (op2, &e->ts, 1); gfc_convert_type (op2, &e->ts, 1);
e = logical_to_bitwise (e); e = logical_to_bitwise (e);
break; goto simplify_op;
} }
sprintf (msg, _("Operands of logical operator %%<%s%%> at %%L are %s/%s"), sprintf (msg, _("Operands of logical operator %%<%s%%> at %%L are %s/%s"),
...@@ -4018,7 +4018,7 @@ resolve_operator (gfc_expr *e) ...@@ -4018,7 +4018,7 @@ resolve_operator (gfc_expr *e)
e->ts.type = BT_INTEGER; e->ts.type = BT_INTEGER;
e->ts.kind = op1->ts.kind; e->ts.kind = op1->ts.kind;
e = logical_to_bitwise (e); e = logical_to_bitwise (e);
break; goto simplify_op;
} }
if (op1->ts.type == BT_LOGICAL) if (op1->ts.type == BT_LOGICAL)
...@@ -4143,8 +4143,6 @@ resolve_operator (gfc_expr *e) ...@@ -4143,8 +4143,6 @@ resolve_operator (gfc_expr *e)
/* Deal with arrayness of an operand through an operator. */ /* Deal with arrayness of an operand through an operator. */
t = true;
switch (e->value.op.op) switch (e->value.op.op)
{ {
case INTRINSIC_PLUS: case INTRINSIC_PLUS:
...@@ -4234,6 +4232,8 @@ resolve_operator (gfc_expr *e) ...@@ -4234,6 +4232,8 @@ resolve_operator (gfc_expr *e)
break; break;
} }
simplify_op:
/* Attempt to simplify the expression. */ /* Attempt to simplify the expression. */
if (t) if (t)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment