This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch for IA64 HP-UX
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 15 Jul 2004 09:04:42 -0700 (PDT)
- Subject: Patch for IA64 HP-UX
- Reply-to: sje at cup dot hp dot com
On the HP-UX IA64 platform (in ILP32 mode with optimization),
expand_builtin_stpcpy was getting called with a NULL target and a
VOIDmode mode. I believe this is legal since they are just
recommendations and not requirements but it was resulting in
expand_builtin_stpcpy creating a VOIDmode register and then a SUBREG
from that and that was resulting in an internal compiler error in
simplify_gen_subreg. This patch checks if mode is VOIDmode and if it is
uses the mode of ret to create the needed register instead of using
VOIDmode, it fixes:
gcc.c-torture/compile/20030518-1.c
gcc.c-torture/execute/builtins/strpcpy.c
gcc.c-torture/execute/builtins/strpcpy-2.c
2004-07-15 Steve Ellcey <sje@cup.hp.com>
* builtins.c (expand_builtin_stpcpy): Do not create temporary
reg with VOIDmode.
*** gcc.orig/gcc/gcc/builtins.c Thu Jul 15 08:41:05 2004
--- gcc/gcc/gcc/builtins.c Thu Jul 15 08:41:22 2004
*************** expand_builtin_stpcpy (tree arglist, rtx
*** 3139,3145 ****
if (ret)
{
if (! target)
! target = gen_reg_rtx (mode);
if (GET_MODE (target) != GET_MODE (ret))
ret = gen_lowpart (GET_MODE (target), ret);
--- 3139,3150 ----
if (ret)
{
if (! target)
! {
! if (mode != VOIDmode)
! target = gen_reg_rtx (mode);
! else
! target = gen_reg_rtx (GET_MODE (ret));
! }
if (GET_MODE (target) != GET_MODE (ret))
ret = gen_lowpart (GET_MODE (target), ret);