aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2009-03-13 02:30:55 +0000
committerJoel Brobecker <brobecker@gnat.com>2009-03-13 02:30:55 +0000
commite15780428b484657ac30649fc48c1a48f13b4f34 (patch)
treef72bf04ee6ac9e38d895604c8727cac802bc87b1
parent383ace49f83190d96ec47b7d8b65e57ff4375c0d (diff)
downloadgdb-e15780428b484657ac30649fc48c1a48f13b4f34.zip
gdb-e15780428b484657ac30649fc48c1a48f13b4f34.tar.gz
gdb-e15780428b484657ac30649fc48c1a48f13b4f34.tar.bz2
* ada-lang.c (ada_evaluate_subexp): Merge case BINOP_REM and
BINOP_MOD cases with the handling of case BINOP_DIV and BINOP_MUL. Remove useless op value checks when EVAL_AVOID_SIDE_EFFECTS.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/ada-lang.c20
2 files changed, 9 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4307293..97f1396 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2009-03-12 Joel Brobecker <brobecker@adacore.com>
+ * ada-lang.c (ada_evaluate_subexp): Merge case BINOP_REM and
+ BINOP_MOD cases with the handling of case BINOP_DIV and BINOP_MUL.
+ Remove useless op value checks when EVAL_AVOID_SIDE_EFFECTS.
+
+2009-03-12 Joel Brobecker <brobecker@adacore.com>
+
* ada-lang.c (ada_evaluate_subexp) <BINOP_DIV>: make sure to
promote the operands when noside is EVAL_AVOID_SIDE_EFFECTS.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index f1a4268..b95a303 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -8452,12 +8452,13 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
case BINOP_MUL:
case BINOP_DIV:
+ case BINOP_REM:
+ case BINOP_MOD:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
goto nosideret;
- else if (noside == EVAL_AVOID_SIDE_EFFECTS
- && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD))
+ else if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2);
return value_zero (value_type (arg1), not_lval);
@@ -8473,21 +8474,6 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
return ada_value_binop (arg1, arg2, op);
}
- case BINOP_REM:
- case BINOP_MOD:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- else if (noside == EVAL_AVOID_SIDE_EFFECTS
- && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD))
- return value_zero (value_type (arg1), not_lval);
- else
- {
- binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2);
- return ada_value_binop (arg1, arg2, op);
- }
-
case BINOP_EQUAL:
case BINOP_NOTEQUAL:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);