aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2005-03-15 15:41:31 +0000
committerJan Beulich <jbeulich@novell.com>2005-03-15 15:41:31 +0000
commit43c3ab55ac48b523629ee064c1a515f2cdb55f83 (patch)
tree7155cb6ffd85dfde29b66628d75a037adb678222 /gas
parent34723071b54c6f1bcc8e705c978efa3ddb47f2b2 (diff)
downloadgdb-43c3ab55ac48b523629ee064c1a515f2cdb55f83.zip
gdb-43c3ab55ac48b523629ee064c1a515f2cdb55f83.tar.gz
gdb-43c3ab55ac48b523629ee064c1a515f2cdb55f83.tar.bz2
gas/
2005-03-15 Jan Beulich <jbeulich@novell.com> * expr.c (operand): Merge handling of unary + into that for unary -, !, and ~.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/expr.c34
2 files changed, 20 insertions, 19 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index d98f5b0..5663525 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-15 Jan Beulich <jbeulich@novell.com>
+
+ * expr.c (operand): Merge handling of unary + into that for unary
+ -, !, and ~.
+
2005-03-14 Eric Christopher <echristo@redhat.com>
* config/tc-mips.c: Include dw2gencfi.h.
diff --git a/gas/expr.c b/gas/expr.c
index fb29fdd..f597c41 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -1011,14 +1011,6 @@ operand (expressionS *expressionP)
mri_char_constant (expressionP);
break;
- case '+':
- /* Do not accept ++e as +(+e).
- Disabled, since the preprocessor removes whitespace. */
- if (0 && *input_line_pointer == '+')
- goto target_op;
- (void) operand (expressionP);
- break;
-
#ifdef TC_M68K
case '"':
/* Double quote is the bitwise not operator in MRI mode. */
@@ -1032,10 +1024,11 @@ operand (expressionS *expressionP)
goto isname;
case '!':
case '-':
+ case '+':
{
- /* Do not accept --e as -(-e)
+ /* Do not accept ++e or --e as +(+e) or -(-e)
Disabled, since the preprocessor removes whitespace. */
- if (0 && c == '-' && *input_line_pointer == '-')
+ if (0 && (c == '-' || c == '+') && *input_line_pointer == c)
goto target_op;
operand (expressionP);
@@ -1052,7 +1045,7 @@ operand (expressionS *expressionP)
}
else if (c == '~' || c == '"')
expressionP->X_add_number = ~ expressionP->X_add_number;
- else
+ else if (c == '!')
expressionP->X_add_number = ! expressionP->X_add_number;
}
else if (expressionP->X_op == O_big
@@ -1099,14 +1092,17 @@ operand (expressionS *expressionP)
else if (expressionP->X_op != O_illegal
&& expressionP->X_op != O_absent)
{
- expressionP->X_add_symbol = make_expr_symbol (expressionP);
- if (c == '-')
- expressionP->X_op = O_uminus;
- else if (c == '~' || c == '"')
- expressionP->X_op = O_bit_not;
- else
- expressionP->X_op = O_logical_not;
- expressionP->X_add_number = 0;
+ if (c != '+')
+ {
+ expressionP->X_add_symbol = make_expr_symbol (expressionP);
+ if (c == '-')
+ expressionP->X_op = O_uminus;
+ else if (c == '~' || c == '"')
+ expressionP->X_op = O_bit_not;
+ else
+ expressionP->X_op = O_logical_not;
+ expressionP->X_add_number = 0;
+ }
}
else
as_warn (_("Unary operator %c ignored because bad operand follows"),