This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Partial patch for PR 11535 (HP-UX IA64 ILP32 __builtin_return_address)
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 31 Jul 2003 09:46:15 -0700 (PDT)
- Subject: Partial patch for PR 11535 (HP-UX IA64 ILP32 __builtin_return_address)
- Reply-to: sje at cup dot hp dot com
This is part of a fix for PR 11535. It prevents CSE from using an
illegal mode on a hard register. I think the REGNO_REG_CLASS was
intended to do that but it isn't sufficient. Even if "first" is legal
for some hard register (i.e. REGNO_REG_CLASS doesn't return NO_REGS),
that doesn't mean it is legal for that register in the mode "ent->mode".
This doesn't completely fix PR 11535, it just moves the problem from cse
down into combine. I have a seperate IA64 specific fix that I will
submit later today to fix the combine part of the problem.
Steve Ellcey
sje@cup.hp.com
2003-07-31 Steve Ellcey <sje@cup.hp.com>
* cse.c: Do not allow illegal mode for hard register.
*** gcc.orig/gcc/gcc/cse.c Thu Jul 31 09:35:39 2003
--- gcc/gcc/gcc/cse.c Thu Jul 31 09:37:34 2003
*************** canon_reg (rtx x, rtx insn)
*** 2766,2771 ****
--- 2766,2772 ----
first = ent->first_reg;
return (first >= FIRST_PSEUDO_REGISTER ? regno_reg_rtx[first]
: REGNO_REG_CLASS (first) == NO_REGS ? x
+ : HARD_REGNO_MODE_OK (first, ent->mode) ? x
: gen_rtx_REG (ent->mode, first));
}