Author: kevans
Date: Fri Jan  3 19:59:42 2020
New Revision: 356327
URL: https://svnweb.freebsd.org/changeset/base/356327

Log:
  mips: csu: fix compilation w/ LLVM
  
  GCC issues the warning, but with LLVM it is fatal- no matching .cprestore
  with .cpload. Reserve some place on the stack and and add the proper
  .cprestore to pair it with.
  
  nop added in the !o32 branch to fill out delay slot instruction, just in
  case.
  
  Reviewed by:  arichardson
  Differential Revision:        https://reviews.freebsd.org/D21697

Modified:
  head/lib/csu/mips/crt.h

Modified: head/lib/csu/mips/crt.h
==============================================================================
--- head/lib/csu/mips/crt.h     Fri Jan  3 18:48:53 2020        (r356326)
+++ head/lib/csu/mips/crt.h     Fri Jan  3 19:59:42 2020        (r356327)
@@ -34,10 +34,14 @@
     "bal       1f              \n"                                     \
     "nop                       \n"                                     \
     "1:                                \n"                                     
\
-    ".cpload $ra               \n"                                     \
+    ".cpload   $ra             \n"                                     \
+    "addu      $sp, $sp, -8    \n"                                     \
     ".set reorder              \n"                                     \
+    ".cprestore        4               \n"                                     
\
     ".local    " __STRING(func) "\n"                                   \
-    "jal       " __STRING(func)
+    "jal       " __STRING(func) "\n"                                   \
+    "nop                       \n"                                     \
+    "addu      $sp, $sp, 8     \n"
 #else
 #define        INIT_CALL_SEQ(func)                                             
\
     ".set noreorder            \n"                                     \
@@ -48,6 +52,7 @@
     ".cpsetup $ra, $v0, 1b     \n"                                     \
     ".local    " __STRING(func) "\n"                                   \
     "jal       " __STRING(func)
+    "nop                       \n"                                     \
 #endif
 
 #endif
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to