From: Uros Bizjak Date: Tue, 24 Jul 2012 11:37:20 +0000 (+0200) Subject: re PR target/53961 (internal compiler error: in memory_address_length, at config... X-Git-Tag: releases/gcc-4.8.0~4304 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9fecd0058bade9acd3161052506e53b90bf57101;p=thirdparty%2Fgcc.git re PR target/53961 (internal compiler error: in memory_address_length, at config/i386/i386.c:23341) 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. From-SVN: r189806 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index af268f45caa1..08722afb81be 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,7 +1,14 @@ +2012-07-24 Uros Bizjak + + 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 - * 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 @@ -17,7 +24,8 @@ (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 @@ -25,7 +33,7 @@ * 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. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index eeb8c823c4bc..efad32c728ad 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -11733,6 +11733,19 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) 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 */ @@ -12242,13 +12255,6 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, 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; diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 114ad134468d..004893404312 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -5450,6 +5450,8 @@ DONE; }) +;; Load effective address instructions + (define_insn_and_split "*lea" [(set (match_operand:SWI48 0 "register_operand" "=r") (match_operand:SWI48 1 "lea_address_operand" "p"))]