https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104894

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bergner at gcc dot gnu.org,
                   |                            |meissner at gcc dot gnu.org

--- Comment #3 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Alan Modra from comment #1)
> Likely "gcc_assert (INTVAL (cookie) == 0);" in
> rs6000_sibcall_aix can just be deleted.

I think it's still useful to ensure we have a valid sibcall.  The problem is
that with pcrel, we have more opportunities to do a sibcall than we did before,
meaning it doesn't matter if the callee has the same TOC value as us, since we
don't use it.  I think we just need to relax the assert when the caller is
pcrel.  The following fixes the ICE and I'm putting it through a bootstrap &
regtest cycle.

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index a7645820b1e..fc5cfeac4fa 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -25659,7 +25659,7 @@ rs6000_sibcall_aix (rtx value, rtx func_desc, rtx
tlsarg, rtx cookie)
   rtx r12 = NULL_RTX;
   rtx func_addr = func_desc;

-  gcc_assert (INTVAL (cookie) == 0);
+  gcc_assert (rs6000_pcrel_p () || INTVAL (cookie) == 0);

   if (global_tlsarg)
     tlsarg = global_tlsarg;

Reply via email to