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

Florian Fuchs <fuchsfl at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fuchsfl at gmail dot com

--- Comment #14 from Florian Fuchs <fuchsfl at gmail dot com> ---
fyi, maybe a workaround. sh_cannot_copy_insn_p() only checked the last element
of a PARALLEL, ashlsi3_d_call has a "clobbers" at this position of pattern, so
it missed. When I check all elements of pat, at least it fixed the compilation
of libgcc for sh2eb-linux-muslfdpic and didn't see more failures of sh
testsuite.

diff --git a/gcc/config/sh/sh.cc b/gcc/config/sh/sh.cc
index 05b0060..d7a7a67 100644
--- a/gcc/config/sh/sh.cc
+++ b/gcc/config/sh/sh.cc
@@ -2895,9 +2895,12 @@ sh_cannot_copy_insn_p (rtx_insn *insn)

   if (TARGET_FDPIC && GET_CODE (pat) == PARALLEL)
     {
-      rtx t = XVECEXP (pat, 0, XVECLEN (pat, 0) - 1);
-      if (GET_CODE (t) == USE && unspec_caller_rtx_p (XEXP (t, 0)))
-       return true;
+      for (int i = 0; i < XVECLEN (pat, 0); i++)
+       {
+         rtx t = XVECEXP (pat, 0, i);
+         if (GET_CODE (t) == USE && unspec_caller_rtx_p (XEXP (t, 0)))
+           return true;
+       }
     }

   if (GET_CODE (pat) != SET)

Reply via email to