This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Tail recursion problem (ptr_mode != Pmode)
- From: Jeffrey Naset <jnaset at rsn dot hp dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 13 Mar 2003 15:52:07 -0600
- Subject: Tail recursion problem (ptr_mode != Pmode)
Hi,
I've found a problem that affects the ia64-hp-hpux11.23 target at the
very least.
gcc (snapshot 2003 0310) is generating 'gengtype' as part of its
bootstrap, and gengtype has incorrect code. In the function
'output_mangled_typename', tail recursion optimization has occurred,
with the flaw that 32-bit pointers aren't getting swizzled prior to use.
In this case, output_mangled_typename takes two args (both pointers),
and they are swizzled at the very top of the function (probably in the
prologue). Later, when a recursive call is made, the args are loaded
(unswizzled, per the calling conventions) and a branch is made, to a
point just after where the pointers are swizzled. Then the program
dies trying to reference memory location in a register that doesn't
have a valid 64-bit pointer value. (It is a valid 32-bit pointer)
[Pmode for the architecture is DImode, ptr_mode in this case is SImode]
If anyone has any ideas on how to fix this, please let me know!
Thanks,
Jeffrey Naset
jeffrey (dot) naset (at) hp (dot) com