From patchwork Mon Oct 29 16:47:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [i386] : Simplify AND-extended address decomposition Date: Mon, 29 Oct 2012 06:47:16 -0000 From: Uros Bizjak X-Patchwork-Id: 195072 Message-Id: To: gcc-patches@gcc.gnu.org Hello! Since we use simplify_gen_subreg on address part, we can use it for DImode subreg of SImode address as well. simplify_gen_subreg knows how to strip subreg. 2012-10-29 Uros Bizjak * config/i386/i386.c (ix86_decompose_address): Use simplify_gen_subreg for all addresses, zero-extended with AND. Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN. Uros. Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 192933) +++ config/i386/i386.c (working copy) @@ -11810,23 +11810,11 @@ ix86_decompose_address (rtx addr, struct ix86_addr else if (GET_CODE (addr) == AND && const_32bit_mask (XEXP (addr, 1), DImode)) { - addr = XEXP (addr, 0); + addr = simplify_gen_subreg (SImode, XEXP (addr, 0), DImode, 0); + if (addr == NULL_RTX) + return 0; - /* Adjust SUBREGs. */ - if (GET_CODE (addr) == SUBREG - && GET_MODE (SUBREG_REG (addr)) == SImode) - { - addr = SUBREG_REG (addr); - if (CONST_INT_P (addr)) - return 0; - } - else if (GET_MODE (addr) == DImode) - { - addr = simplify_gen_subreg (SImode, addr, DImode, 0); - if (addr == NULL_RTX) - return 0; - } - else if (GET_MODE (addr) != VOIDmode) + if (CONST_INT_P (addr)) return 0; } }