diff options
author | Alan Modra <amodra@gmail.com> | 2010-08-02 13:19:44 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2010-08-02 13:19:44 +0000 |
commit | 93d90f466b0a6faa6a7811187139f66a2b9c9c74 (patch) | |
tree | 85e142a800851131e9b31396f45fb7cbea900c96 /gas/expr.c | |
parent | 5f1ab67afc4b968ef1de25b13f644fd20ac029d9 (diff) | |
download | binutils-93d90f466b0a6faa6a7811187139f66a2b9c9c74.zip binutils-93d90f466b0a6faa6a7811187139f66a2b9c9c74.tar.gz binutils-93d90f466b0a6faa6a7811187139f66a2b9c9c74.tar.bz2 |
PR gas/11867
* expr.c (operand <'-' and '~'>): Widen bignums.
(operand <'!'>): Correct bignum result and convert to O_constant.
* read.c (emit_expr): Don't assert on .byte bignum. Don't display
bignum truncated warning for sign extended bignums.
Diffstat (limited to 'gas/expr.c')
-rw-r--r-- | gas/expr.c | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -1056,6 +1056,15 @@ operand (expressionS *expressionP, enum expr_mode mode) { for (i = 0; i < expressionP->X_add_number; ++i) generic_bignum[i] = ~generic_bignum[i]; + + /* Extend the bignum to at least the size of .octa. */ + if (expressionP->X_add_number < SIZE_OF_LARGE_NUMBER) + { + expressionP->X_add_number = SIZE_OF_LARGE_NUMBER; + for (; i < expressionP->X_add_number; ++i) + generic_bignum[i] = ~(LITTLENUM_TYPE) 0; + } + if (c == '-') for (i = 0; i < expressionP->X_add_number; ++i) { @@ -1066,14 +1075,12 @@ operand (expressionS *expressionP, enum expr_mode mode) } else if (c == '!') { - int nonzero = 0; for (i = 0; i < expressionP->X_add_number; ++i) - { - if (generic_bignum[i]) - nonzero = 1; - generic_bignum[i] = 0; - } - generic_bignum[0] = nonzero; + if (generic_bignum[i] != 0) + break; + expressionP->X_add_number = i >= expressionP->X_add_number; + expressionP->X_op = O_constant; + expressionP->X_unsigned = 1; } } else if (expressionP->X_op != O_illegal |