+2012-07-24 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/53961
+ * config/i386/i386.c (ix86_legitimate_address_p): Move check for
+ negative constant address for TARET_X32 ...
+ (ix86_decompose_address): ... here. Reject constant addresses
+ that don't satisfy x86_64_immediate_operand predicate.
+
2012-07-24 Julian Brown <julian@codesourcery.com>
- * doc/sourcebuild.texi (arm_hf_eabi): Document effective-target
- check.
+ * doc/sourcebuild.texi (arm_hf_eabi): Document effective-target check.
2012-07-24 Steven Bosscher <steven@gcc.gnu.org>
(GCC_MEM_STAT_ARGUMENTS): New define.
(ALONE_MEM_STAT_DECL): Define in terms of GCC_MEM_STAT_ARGUMENTS.
(ALONE_FINAL_MEM_STAT_DECL, ALONE_FINAL_PASS_MEM_STAT): New defines.
- (MEM_STAT_DECL, FINAL_MEM_STAT_DECL, PASS_MEM_STAT, FINAL_PASS_MEM_STAT,
+ (MEM_STAT_DECL, FINAL_MEM_STAT_DECL, PASS_MEM_STAT,
+ FINAL_PASS_MEM_STAT): Define.
* ggc-internal.h (ggc_record_overhead): Use FINAL_MEM_STAT_DECL.
* ggc.h (ggc_record_overhead, ggc_free_overhead,
ggc_prune_overhead_list): Remove internal prototypes, they are defined
* ggc-common.c (struct loc_descriptor): Remove #ifdef GATHER_STATISTICS
wrappers.
(add_statistics): Likewise.
- (dump_ggc_loc_statistics): Likewise. Return if GATHER_STATISTICS is 0.
+ (dump_ggc_loc_statistics): Likewise. Return if GATHER_STATISTICS is 0.
* ggc-zone.c (struct page_entry): Remove #ifdef GATHER_STATISTICS
wrappers around "survived" and "stats" members.
(alloc_large_page): Always initialize survived.
scale = 1 << scale;
retval = -1;
}
+ else if (CONST_INT_P (addr))
+ {
+ if (!x86_64_immediate_operand (addr, VOIDmode))
+ return 0;
+
+ /* Constant addresses are sign extended to 64bit, we have to
+ prevent addresses from 0x80000000 to 0xffffffff in x32 mode. */
+ if (TARGET_X32
+ && val_signbit_known_set_p (SImode, INTVAL (addr)))
+ return 0;
+
+ disp = addr;
+ }
else
disp = addr; /* displacement */
rtx base, index, disp;
HOST_WIDE_INT scale;
- /* Since constant address in x32 is signed extended to 64bit,
- we have to prevent addresses from 0x80000000 to 0xffffffff. */
- if (TARGET_X32
- && CONST_INT_P (addr)
- && INTVAL (addr) < 0)
- return false;
-
if (ix86_decompose_address (addr, &parts) <= 0)
/* Decomposition failed. */
return false;