diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2012-07-24 13:37:20 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2012-07-24 13:37:20 +0200 |
commit | 9fecd0058bade9acd3161052506e53b90bf57101 (patch) | |
tree | 2f43e4a2afdf8a9215d700db9b4e3b5f4810dd7c /gcc | |
parent | 552b56fcf26648938a107c54548551e39b1f6430 (diff) | |
download | gcc-9fecd0058bade9acd3161052506e53b90bf57101.zip gcc-9fecd0058bade9acd3161052506e53b90bf57101.tar.gz gcc-9fecd0058bade9acd3161052506e53b90bf57101.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 20 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 2 |
3 files changed, 27 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index af268f4..08722af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,7 +1,14 @@ +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> @@ -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 eeb8c82..efad32c 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 114ad13..0048934 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<mode>" [(set (match_operand:SWI48 0 "register_operand" "=r") (match_operand:SWI48 1 "lea_address_operand" "p"))] |