aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorDaniel Franke <franke.daniel@gmail.com>2007-07-08 17:08:52 -0400
committerDaniel Franke <dfranke@gcc.gnu.org>2007-07-08 17:08:52 -0400
commit3bed9dd0236405001fc0aeccf7fa37b1ff4ecc9f (patch)
treea93c7993fbd8df93d9b727f1a469eb1a7ed79a38 /gcc/fortran/expr.c
parent376397285d1564cb838083028fa24286cd101ca6 (diff)
downloadgcc-3bed9dd0236405001fc0aeccf7fa37b1ff4ecc9f.zip
gcc-3bed9dd0236405001fc0aeccf7fa37b1ff4ecc9f.tar.gz
gcc-3bed9dd0236405001fc0aeccf7fa37b1ff4ecc9f.tar.bz2
re PR fortran/17711 (Wrong operator name in error message)
gcc/fortran: 2007-07-08 Daniel Franke <franke.daniel@gmail.com> Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/17711 * gfortran.h (gfc_intrinsic_op): Added INTRINSIC_EQ_OS, INTRINSIC_NE_OS, INTRINSIC_GT_OS, INTRINSIC_GE_OS, INTRINSIC_LT_OS and INTRINSIC_LE_OS. * arith.c (eval_intrinsic, eval_type_intrinsic0): Likewise. * arith.h (gfc_eq, gfc_ne, gfc_gt, gfc_ge, gfc_lt, gfc_le): Added gfc_intrinsic_op as third argument type. * dump-parse-tree.c (gfc_show_expr): Account for new enum values. * expr.c (simplify_intrinsic_op, check_intrinsic_op): Likewise. * interface.c (check_operator_interface): Likewise. (gfc_check_interfaces): Added cross-checks for FORTRAN 77 and Fortran 90 style operators using new enum values. (gfc_extend_expr): Likewise. (gfc_add_interface): Likewise. * match.c (intrinsic_operators): Distinguish FORTRAN 77 style operators from Fortran 90 style operators using new enum values. * matchexp.c (match_level_4): Account for new enum values. * module.c (mio_expr): Likewise. * resolve.c (resolve_operator): Deal with new enum values, fix inconsistent error messages. * trans-expr.c (gfc_conv_expr_op): Account for new enum values. gcc/testsuite: 2007-07-08 Daniel Franke <franke.daniel@gmail.com> PR fortran/17711 * gfortran.dg/operator_4.f90: New test. * gfortran.dg/operator_5.f90: New test. * gfortran.dg/logical_comp.f90: Adjusted error messages. * gfortran.dg/module_md5_1.f90: Adjusted MD5 sum. Co-Authored-By: Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> From-SVN: r126468
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 0ca7dbf..d90dd21 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -766,6 +766,7 @@ gfc_is_constant_expr (gfc_expr *e)
static try
simplify_intrinsic_op (gfc_expr *p, int type)
{
+ gfc_intrinsic_op op;
gfc_expr *op1, *op2, *result;
if (p->value.op.operator == INTRINSIC_USER)
@@ -773,6 +774,7 @@ simplify_intrinsic_op (gfc_expr *p, int type)
op1 = p->value.op.op1;
op2 = p->value.op.op2;
+ op = p->value.op.operator;
if (gfc_simplify_expr (op1, type) == FAILURE)
return FAILURE;
@@ -787,7 +789,7 @@ simplify_intrinsic_op (gfc_expr *p, int type)
p->value.op.op1 = NULL;
p->value.op.op2 = NULL;
- switch (p->value.op.operator)
+ switch (op)
{
case INTRINSIC_PARENTHESES:
result = gfc_parentheses (op1);
@@ -826,27 +828,33 @@ simplify_intrinsic_op (gfc_expr *p, int type)
break;
case INTRINSIC_EQ:
- result = gfc_eq (op1, op2);
+ case INTRINSIC_EQ_OS:
+ result = gfc_eq (op1, op2, op);
break;
case INTRINSIC_NE:
- result = gfc_ne (op1, op2);
+ case INTRINSIC_NE_OS:
+ result = gfc_ne (op1, op2, op);
break;
case INTRINSIC_GT:
- result = gfc_gt (op1, op2);
+ case INTRINSIC_GT_OS:
+ result = gfc_gt (op1, op2, op);
break;
case INTRINSIC_GE:
- result = gfc_ge (op1, op2);
+ case INTRINSIC_GE_OS:
+ result = gfc_ge (op1, op2, op);
break;
case INTRINSIC_LT:
- result = gfc_lt (op1, op2);
+ case INTRINSIC_LT_OS:
+ result = gfc_lt (op1, op2, op);
break;
case INTRINSIC_LE:
- result = gfc_le (op1, op2);
+ case INTRINSIC_LE_OS:
+ result = gfc_le (op1, op2, op);
break;
case INTRINSIC_NOT:
@@ -1731,11 +1739,17 @@ check_intrinsic_op (gfc_expr *e, try (*check_function) (gfc_expr *))
break;
case INTRINSIC_EQ:
+ case INTRINSIC_EQ_OS:
case INTRINSIC_NE:
+ case INTRINSIC_NE_OS:
case INTRINSIC_GT:
+ case INTRINSIC_GT_OS:
case INTRINSIC_GE:
+ case INTRINSIC_GE_OS:
case INTRINSIC_LT:
+ case INTRINSIC_LT_OS:
case INTRINSIC_LE:
+ case INTRINSIC_LE_OS:
if ((*check_function) (op2) == FAILURE)
return FAILURE;