aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-04-06 03:16:20 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-04-06 03:16:20 +0000
commit5a7a0b7bf98b702f8caf3e599e6eeb6631a50680 (patch)
treefdf0f46c573e5ea4eff2a55ac13c381c9a04afda /gas/config/tc-mips.c
parent43bd9a9e02a1279590947a8d7258108207896ba8 (diff)
downloadgdb-5a7a0b7bf98b702f8caf3e599e6eeb6631a50680.zip
gdb-5a7a0b7bf98b702f8caf3e599e6eeb6631a50680.tar.gz
gdb-5a7a0b7bf98b702f8caf3e599e6eeb6631a50680.tar.bz2
* config/tc-mips.c (HAVE_64BIT_ADDRESS_CONSTANTS): New.
(macro): Use new macro to decide whether to emit constant address as 32 or 64 bits if addresses are 32-bit wide but registers are 64-bit wide.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r--gas/config/tc-mips.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 2e114f4..e07dde3 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -294,6 +294,8 @@ static int mips_32bitmode = 0;
&& mips_pic != EMBEDDED_PIC))
#define HAVE_64BIT_ADDRESSES (! HAVE_32BIT_ADDRESSES)
+#define HAVE_64BIT_ADDRESS_CONSTANTS (HAVE_64BIT_ADDRESSES \
+ || HAVE_64BIT_GPRS)
/* Return true if the given CPU supports the MIPS16 ASE. */
#define CPU_HAS_MIPS16(cpu) \
@@ -5845,9 +5847,10 @@ macro (ip)
probably attempt to generate 64-bit constants more
efficiently in general.
*/
- if (HAVE_64BIT_ADDRESSES
- && !(offset_expr.X_op == O_constant
- && IS_SEXT_32BIT_NUM (offset_expr.X_add_number + 0x8000)))
+ if ((offset_expr.X_op != O_constant && HAVE_64BIT_ADDRESSES)
+ || (offset_expr.X_op == O_constant
+ && !IS_SEXT_32BIT_NUM (offset_expr.X_add_number)
+ && HAVE_64BIT_ADDRESS_CONSTANTS))
{
p = NULL;
@@ -5894,6 +5897,9 @@ macro (ip)
return;
}
+ else if (offset_expr.X_op == O_constant
+ && !IS_SEXT_32BIT_NUM (offset_expr.X_add_number))
+ as_bad (_("load/store address overflow (max 32 bits)"));
if (breg == 0)
{