From: Richard Henderson Date: Fri, 9 Jan 2004 02:31:40 +0000 (-0800) Subject: re PR rtl-optimization/12441 (Can't spill register bug) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90e4e4c58d96511359fcede8e00658953ae9faaa;p=gcc.git re PR rtl-optimization/12441 (Can't spill register bug) 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: r75568 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8c0b784e7b2..208ee947d7c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2004-01-08 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-08 Kelley Cook * Makefile.in: Rename configure.in to configure.ac diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 04ffe7ec3fc..709e6c25c35 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4257,11 +4257,6 @@ aligned_operand (rtx op, enum machine_mode 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) { @@ -5480,7 +5475,7 @@ 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 (GET_CODE (addr) == REG || GET_CODE (addr) == SUBREG) base = addr; else if (GET_CODE (addr) == PLUS) { @@ -5632,11 +5627,6 @@ ix86_address_cost (rtx 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--; @@ -5981,15 +5971,9 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int 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; @@ -6001,8 +5985,8 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int 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; @@ -6017,15 +6001,9 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int 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; @@ -6037,8 +6015,8 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int 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;