* gcc.c (default_arg): Don't wander off the end of allocated
memory.
+ (From Geoffrey Keating <geoffk@ozemail.com.au>)
+ * rs6000.c (small_data_operand): Ensure that any address
+ referenced relative to the small data area is inside the SDA.
+
Mon Mar 16 12:55:15 1998 Jim Wilson <wilson@cygnus.com>
* config/m68k/netbsd.h (ASM_SPEC): Add %{m68060}.
return 0;
else
- sym_ref = XEXP (XEXP (op, 0), 0);
+ {
+ rtx sum = XEXP (op, 0);
+ HOST_WIDE_INT summand;
+
+ /* We have to be careful here, because it is the referenced address
+ that must be 32k from _SDA_BASE_, not just the symbol. */
+ summand = INTVAL (XEXP (sum, 1));
+ if (summand < 0 || summand > g_switch_value)
+ return 0;
+
+ sym_ref = XEXP (sum, 0);
+ }
if (*XSTR (sym_ref, 0) != '@')
return 0;