]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
powerpc: fix ifunc-sel.h fix asm constraints and clobber list
authorAurelien Jarno <aurelien@aurel32.net>
Tue, 2 Aug 2016 22:22:44 +0000 (00:22 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 14 Aug 2016 20:48:23 +0000 (22:48 +0200)
As pointer out on the mailing list, the inline assembly code in
sysdeps/powerpc/ifunc-sel.h doesn't have a list of clobbered registers
and used wrong constraints.

This patch fixes that. I verified it doesn't introduce any change in the
generated code.

Changelog:
* sysdeps/powerpc/ifunc-sel.h (ifunc_sel): Add "11", "12", "cr0" to the
clobber list. Use "i" constraint instead of "X".
(ifunc_one): Add "12" to the clobber list. Use "i" constraint instead
of "X".

(cherry picked from commit 30f926d3b3dcb74c038155715ed341d5c4b334eb)

ChangeLog
sysdeps/powerpc/ifunc-sel.h

index 16aa09d97f45817f5bc433baac84ded2ea6532d6..7ef0fe60061e5b234044870ec39824b6c381b8db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 
        * sysdeps/powerpc/ifunc-sel.h (ifunc_sel): Replace beqlr instructions
        by beq instructions jumping to the end of the function.
+       * sysdeps/powerpc/ifunc-sel.h (ifunc_sel): Add "11", "12", "cr0" to the
+       clobber list. Use "i" constraint instead of "X".
+       (ifunc_one): Add "12" to the clobber list. Use "i" constraint instead
+       of "X".
 
 2016-08-04  Carlos O'Donell  <carlos@redhat.com>
 
index 79d110fef13af29c38ada519570acc9caeaaa446..ac589bd3c049b7ceed766c9c1697a0d0c2b8e81b 100644 (file)
@@ -26,7 +26,8 @@ ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void))
           "addi %0,%0,%4-1b@l\n\t"
           "2:"
           : "=r" (ret)
-          : "X" (&global), "X" (f1), "X" (f2), "X" (f3));
+          : "i" (&global), "i" (f1), "i" (f2), "i" (f3)
+          : "11", "12", "cr0");
   return ret;
 }
 
@@ -41,7 +42,8 @@ ifunc_one (int (*f1) (void))
           "addis %0,%0,%1-1b@ha\n\t"
           "addi %0,%0,%1-1b@l"
           : "=r" (ret)
-          : "X" (f1));
+          : "i" (f1)
+          : "12");
   return ret;
 }
 #endif