This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix for elimination within SUBREG bug
- To: gcc-patches at gcc dot gnu dot org
- Subject: Fix for elimination within SUBREG bug
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Sun, 3 Jun 01 22:03:45 EDT
This is part of the fix for the bug I recently raised on the GCC list.
I think more cleanup is needed, but am not sure exactly what. This fixes
the problem (compiling md5 on Sparc64 for VxWorks) and bootstraps on
Alphaev56. This may be a regression from GCC 2.95, but probably isn't
worth doing anything about.
Sun Jun 3 21:59:51 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (reload_inner_reg_of_subreg): Return 1 for PLUS.
(push_reload): Handle non-REG in reload_inner_reg_of_subreg case.
*** reload.c 2001/05/01 12:11:33 1.146
--- reload.c 2001/06/04 00:10:37
*************** reload_inner_reg_of_subreg (x, mode)
*** 781,786 ****
inner = SUBREG_REG (x);
! /* If INNER is a constant, then INNER must be reloaded. */
! if (CONSTANT_P (inner))
return 1;
--- 782,787 ----
inner = SUBREG_REG (x);
! /* If INNER is a constant or PLUS, then INNER must be reloaded. */
! if (CONSTANT_P (inner) || GET_CODE (inner) == PLUS)
return 1;
*************** push_reload (in, out, inloc, outloc, cla
*** 1031,1034 ****
--- 1032,1045 ----
if (in != 0 && reload_inner_reg_of_subreg (in, inmode))
{
+ enum reg_class in_class = class;
+
+ if (GET_CODE (SUBREG_REG (in)) == REG)
+ in_class
+ = find_valid_class (inmode,
+ subreg_regno_offset (REGNO (SUBREG_REG (in)),
+ GET_MODE (SUBREG_REG (in)),
+ SUBREG_BYTE (in),
+ GET_MODE (in)));
+
/* This relies on the fact that emit_reload_insns outputs the
instructions for input reloads of type RELOAD_OTHER in the same
*************** push_reload (in, out, inloc, outloc, cla
*** 1036,1046 ****
RELOAD_OTHER, we are guaranteed that this inner reload will be
output before the outer reload. */
! push_reload (SUBREG_REG (in), NULL_RTX, &SUBREG_REG (in), (rtx*)0,
! find_valid_class (inmode,
! subreg_regno_offset (REGNO (SUBREG_REG (in)),
! GET_MODE (SUBREG_REG (in)),
! SUBREG_BYTE (in),
! GET_MODE (in))),
! VOIDmode, VOIDmode, 0, 0, opnum, type);
dont_remove_subreg = 1;
}
--- 1047,1052 ----
RELOAD_OTHER, we are guaranteed that this inner reload will be
output before the outer reload. */
! push_reload (SUBREG_REG (in), NULL_RTX, &SUBREG_REG (in), NULL_RTX,
! in_class, VOIDmode, VOIDmode, 0, 0, opnum, type);
dont_remove_subreg = 1;
}