From 1fd5f4fc624288d5ae6c98908f58102588a031a3 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 8 Sep 1997 19:32:05 +0000 Subject: [PATCH] Added -mwarn_unsigned_overflow so that defuault is to treat unsigned values as signed values if they start to overflow. --- gas/ChangeLog | 5 +++++ gas/config/tc-v850.c | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 60ed055e9b2..aeece7bb478 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +Mon Sep 8 12:33:40 1997 Nick Clifton + + * config/tc-v850.c (v850_insert_operand): Add + -mwarn_unsigned_overflow. + Mon Sep 8 11:20:46 1997 Ian Lance Taylor * as.h: Don't declare alloca if it is a macro. diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index 6d708c51cf3..6bf5c2c94e8 100644 --- a/gas/config/tc-v850.c +++ b/gas/config/tc-v850.c @@ -32,6 +32,7 @@ static bfd_reloc_code_real_type hold_cons_reloc; /* Set to TRUE if we want to be pedantic about signed overflows. */ static boolean warn_signed_overflows = FALSE; +static boolean warn_unsigned_overflows = FALSE; /* Structure to hold information about predefined registers. */ @@ -776,6 +777,12 @@ md_parse_option (c, arg) return 1; } + if (c == 'w' && strcmp (arg, "unsigned_overflow") == 0) + { + warn_unsigned_overflows = TRUE; + return 1; + } + return 0; } @@ -1646,7 +1653,11 @@ v850_insert_operand (insn, operand, val, file, line) else { max = (1 << operand->bits) - 1; - min = 0; + + if (! warn_unsigned_overflows) + min = - (1 << (operand->bits - 1)); + else + min = 0; } test = val; -- 2.30.2