From 5e27a6d4ff8a07b33550095c5c2d848a5eef7394 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 20 Jul 2011 14:58:28 +0200 Subject: [PATCH] re PR target/49780 ([x32] internal compiler error: in create_mem_ref, at tree-ssa-address.c:806) PR target/49780 * config/i386/predicates.md (no_seg_addres_operand): No more special. * config/i386/i386.c (ix86_decompose_address): Allow only subregs of DImode hard registers in base. (ix86_legitimate_address_p): Allow SImode and DImode base and index registers. From-SVN: r176506 --- gcc/ChangeLog | 16 ++++++++++++---- gcc/config/i386/i386.c | 16 +++++++++++----- gcc/config/i386/predicates.md | 2 +- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3ee9bfb7334..4f8934a0e30 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,7 +1,15 @@ +2011-07-20 Uros Bizjak + + PR target/49780 + * config/i386/predicates.md (no_seg_addres_operand): No more special. + * config/i386/i386.c (ix86_decompose_address): Allow only subregs + of DImode hard registers in base. + (ix86_legitimate_address_p): Allow SImode and DImode base and index + registers. + 2011-07-20 Richard Guenther - * tree-ssa-structalias.c (new_var_info): Allocate oldsolution - lazily. + * tree-ssa-structalias.c (new_var_info): Allocate oldsolution lazily. (unify_nodes): Deal with that. (solve_graph): Likewise. @@ -91,8 +99,8 @@ (GNU_USER_LINK_EMULATION32, GNU_USER_LINK_EMULATION64) (GNU_USER_LINK_EMULATIONN32): New macros. - * config.gcc (mips64*-*-linux* | mipsisa64*-*-linux* | - mips-*-linux*): Use the new headers. + * config.gcc (mips64*-*-linux* | mipsisa64*-*-linux* | mips-*-linux*): + Use the new headers. 2011-07-19 Richard Sandiford diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 814250fa24e..22f756b47fd 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -11085,8 +11085,16 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) int retval = 1; enum ix86_address_seg seg = SEG_DEFAULT; - if (REG_P (addr) || GET_CODE (addr) == SUBREG) + if (REG_P (addr)) base = addr; + else if (GET_CODE (addr) == SUBREG) + { + /* Allow only subregs of DImode hard regs. */ + if (register_no_elim_operand (SUBREG_REG (addr), DImode)) + base = addr; + else + return 0; + } else if (GET_CODE (addr) == PLUS) { rtx addends[4], op; @@ -11643,8 +11651,7 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, /* Base is not a register. */ return false; - if (GET_MODE (base) != Pmode) - /* Base is not in Pmode. */ + if (GET_MODE (base) != SImode && GET_MODE (base) != DImode) return false; if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg)) @@ -11672,8 +11679,7 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, /* Index is not a register. */ return false; - if (GET_MODE (index) != Pmode) - /* Index is not in Pmode. */ + if (GET_MODE (index) != SImode && GET_MODE (index) != DImode) return false; if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg)) diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index 2c75147474e..fd935053f47 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -796,7 +796,7 @@ ;; Return true if op if a valid address, and does not contain ;; a segment override. -(define_special_predicate "no_seg_address_operand" +(define_predicate "no_seg_address_operand" (match_operand 0 "address_operand") { struct ix86_address parts;