This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch for HP-UX IA64 ILP32 optimization bug
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: jnaset at rsn dot hp dot com, roger at www dot eyesopen dot com
- Date: Fri, 14 Mar 2003 09:06:49 -0800 (PST)
- Subject: Patch for HP-UX IA64 ILP32 optimization bug
- Reply-to: sje at cup dot hp dot com
There is a bug in the tail recursion optimization that is affecting IA64
HP-UX when in ILP32 mode. I submitted a patch for this last year but
somehow it got lost in the shuffle. The basic problem is that pointers
are not being extended properly in tail_recursion_args when doing the
tail recursion optimization.
This patch tested fine on HP-UX but I am a little concerned about
setting unsignedp once and using it in the two different convert_move
calls. This matches the current behavour where the same value
(TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a)))) is used in both calls but I
am not sure that is right either.
This bug is causing a failure during the execution of gengtype when
bootstrapping ia64-hpux with optimization on so I would like to fix it
for 3.3 and top-of-tree.
Steve Ellcey
sje at cup dot hp dot com
2003-03-14 Steve Ellcey <sje at cup dot hp dot com>
* stmt.c (tail_recursion_args): Call promote_mode to set
unsignedp flag correctly before calling convert_move.
*** gcc.orig/gcc/stmt.c Thu Mar 13 09:47:19 2003
--- gcc/gcc/stmt.c Thu Mar 13 09:53:32 2003
*************** tail_recursion_args (actuals, formals)
*** 3334,3348 ****
else
{
rtx tmp = argvec[i];
!
if (DECL_MODE (f) != GET_MODE (DECL_RTL (f)))
{
tmp = gen_reg_rtx (DECL_MODE (f));
! convert_move (tmp, argvec[i],
! TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a))));
}
! convert_move (DECL_RTL (f), tmp,
! TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a))));
}
}
--- 3334,3348 ----
else
{
rtx tmp = argvec[i];
! int unsignedp = TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a)));
! promote_mode(TREE_TYPE (TREE_VALUE (a)), GET_MODE (tmp),
! &unsignedp, 0);
if (DECL_MODE (f) != GET_MODE (DECL_RTL (f)))
{
tmp = gen_reg_rtx (DECL_MODE (f));
! convert_move (tmp, argvec[i], unsignedp);
}
! convert_move (DECL_RTL (f), tmp, unsignedp);
}
}