]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86_64: Fix asm constraints in feraiseexcept (bug 30305)
authorFlorian Weimer <fweimer@redhat.com>
Mon, 3 Apr 2023 15:23:11 +0000 (17:23 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 24 Apr 2023 13:34:29 +0000 (15:34 +0200)
The divss instruction clobbers its first argument, and the constraints
need to reflect that.  Fortunately, with GCC 12, generated code does
not actually change, so there is no externally visible bug.

Suggested-by: Jakub Jelinek <jakub@redhat.com>
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
(cherry picked from commit 5d1ccdda7b0c625751661d50977f3dfbc73f8eae)

NEWS
sysdeps/x86_64/fpu/fraiseexcpt.c

diff --git a/NEWS b/NEWS
index 157f136e4813f459a0c977f66407df9801d04e85..570912f01b5a7599246ca8a440ab825a3ffb4ebd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -74,6 +74,7 @@ The following bugs are resolved with this release:
   [29953] x86: Check minimum/maximum of non_temporal_threshold
   [30053] time: strftime %s returns -1 after 2038 on 32 bits systems
   [30151] gshadow: Matching sgetsgent, sgetsgent_r ERANGE handling
+  [30305] x86_64: Fix asm constraints in feraiseexcept
 
 \f
 Version 2.35
index 864f4777a26d740c6a33357c2227fd25c3770f85..23446ff4acd90aae828086688d621afde5aad303 100644 (file)
@@ -33,7 +33,7 @@ __feraiseexcept (int excepts)
       /* One example of an invalid operation is 0.0 / 0.0.  */
       float f = 0.0;
 
-      __asm__ __volatile__ ("divss %0, %0 " : : "x" (f));
+      __asm__ __volatile__ ("divss %0, %0 " : "+x" (f));
       (void) &f;
     }
 
@@ -43,7 +43,7 @@ __feraiseexcept (int excepts)
       float f = 1.0;
       float g = 0.0;
 
-      __asm__ __volatile__ ("divss %1, %0" : : "x" (f), "x" (g));
+      __asm__ __volatile__ ("divss %1, %0" : "+x" (f) : "x" (g));
       (void) &f;
     }