From: Matthias Klose Date: Mon, 12 Jan 2004 09:02:27 +0000 (+0000) Subject: backport: re PR rtl-optimization/12441 (Can't spill register bug) X-Git-Tag: releases/gcc-3.3.3~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40cc32cac9f623722244c91b6c165e9624ed255a;p=thirdparty%2Fgcc.git backport: re PR rtl-optimization/12441 (Can't spill register bug) 2004-01-12 Matthias Klose Backport from mainline 2004-01-11 Richard Henderson PR opt/12441 Revert: Sat Mar 30 14:08:55 CET 2002 Jan Hubicka * i386.c (aligned_operand): Be prepared for SUBREGed registers. (ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG. (ix86_address_cost): Be prepared for SUBREGed registers. (legitimate_address_p): Accept SUBREGed registers. From-SVN: r75708 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ef6f63e78c15..85568bc64622 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2004-01-12 Matthias Klose + + Backport from mainline + + 2004-01-11 Richard Henderson + PR opt/12441 + Revert: Sat Mar 30 14:08:55 CET 2002 Jan Hubicka + * i386.c (aligned_operand): Be prepared for SUBREGed registers. + (ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG. + (ix86_address_cost): Be prepared for SUBREGed registers. + (legitimate_address_p): Accept SUBREGed registers. + 2004-01-11 Richard Henderson * config/alpha/alpha.c (alpha_encode_section_info): Use 'I' diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0b845cfd6d3c..0661d0a59a30 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3925,11 +3925,6 @@ aligned_operand (op, mode) if (! ix86_decompose_address (op, &parts)) abort (); - if (parts.base && GET_CODE (parts.base) == SUBREG) - parts.base = SUBREG_REG (parts.base); - if (parts.index && GET_CODE (parts.index) == SUBREG) - parts.index = SUBREG_REG (parts.index); - /* Look for some component that isn't known to be aligned. */ if (parts.index) { @@ -5000,7 +4995,7 @@ ix86_decompose_address (addr, out) rtx scale_rtx = NULL_RTX; int retval = 1; - if (REG_P (addr) || GET_CODE (addr) == SUBREG) + if (GET_CODE (addr) == REG || GET_CODE (addr) == SUBREG) base = addr; else if (GET_CODE (addr) == PLUS) { @@ -5127,11 +5122,6 @@ ix86_address_cost (x) if (!ix86_decompose_address (x, &parts)) abort (); - if (parts.base && GET_CODE (parts.base) == SUBREG) - parts.base = SUBREG_REG (parts.base); - if (parts.index && GET_CODE (parts.index) == SUBREG) - parts.index = SUBREG_REG (parts.index); - /* More complex memory references are better. */ if (parts.disp && parts.disp != const0_rtx) cost--; @@ -5504,15 +5494,9 @@ legitimate_address_p (mode, addr, strict) if (base) { - rtx reg; reason_rtx = base; - if (GET_CODE (base) == SUBREG) - reg = SUBREG_REG (base); - else - reg = base; - - if (GET_CODE (reg) != REG) + if (GET_CODE (base) != REG) { reason = "base is not a register"; goto report_error; @@ -5524,8 +5508,8 @@ legitimate_address_p (mode, addr, strict) goto report_error; } - if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg)) - || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (reg))) + if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base)) + || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base))) { reason = "base is not valid"; goto report_error; @@ -5540,15 +5524,9 @@ legitimate_address_p (mode, addr, strict) if (index) { - rtx reg; reason_rtx = index; - if (GET_CODE (index) == SUBREG) - reg = SUBREG_REG (index); - else - reg = index; - - if (GET_CODE (reg) != REG) + if (GET_CODE (index) != REG) { reason = "index is not a register"; goto report_error; @@ -5560,8 +5538,8 @@ legitimate_address_p (mode, addr, strict) goto report_error; } - if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg)) - || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (reg))) + if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (index)) + || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (index))) { reason = "index is not valid"; goto report_error;