From ff71e554beee40f627444101b9567b1868c24650 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 13 Mar 2012 17:21:23 +0100 Subject: [PATCH] i386.c (ix86_decompose_address): Handle subregs of AND zero extended address correctly. * config/i386/i386.c (ix86_decompose_address): Handle subregs of AND zero extended address correctly. From-SVN: r185343 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4c6c6ed4ec2..9280a31f311 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-03-13 Uros Bizjak + + * config/i386/i386.c (ix86_decompose_address): Handle subregs of + AND zero extended address correctly. + 2012-03-13 Uros Bizjak * config/i386/predicates.md (tls_symbolic_operand): Declare as diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 1a18dc7a3f2..24f51fb20cb 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -11435,10 +11435,14 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) { addr = XEXP (addr, 0); - /* Strip subreg. */ - if (GET_CODE (addr) == SUBREG - && GET_MODE (SUBREG_REG (addr)) == SImode) + /* Adjust SUBREGs. */ + if (GET_MODE (addr) == DImode) + addr = gen_rtx_SUBREG (SImode, addr, 0); + else if (GET_CODE (addr) == SUBREG + && GET_MODE (SUBREG_REG (addr)) == SImode) addr = SUBREG_REG (addr); + else + return 0; } }