Fix -fdec simplification (PR fortran/88649).
authorMartin Liska <mliska@suse.cz>
Wed, 13 Feb 2019 13:04:56 +0000 (14:04 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 13 Feb 2019 13:04:56 +0000 (13:04 +0000)
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

gcc/fortran/ChangeLog
gcc/fortran/resolve.c

index 1ca41dc..c573f77 100644 (file)
@@ -1,3 +1,10 @@
+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>
 
        PR fortran/71723
index 3a8f402..e215fef 100644 (file)
@@ -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)
     {