about summary refs log tree commit diff
path: root/sysdeps/x86_64
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2023-04-03 17:23:11 +0200
committerFlorian Weimer <fweimer@redhat.com>2023-04-24 16:00:13 +0200
commit71eb9cc1ffd79e96549dfb16f8e86aaf88a3bac8 (patch)
treefba5c3625865b8affd2ed79e7afa38159b3373f0 /sysdeps/x86_64
parent6a0d56b009e34caea9cbc0bbec3272345ea8f55a (diff)
downloadglibc-71eb9cc1ffd79e96549dfb16f8e86aaf88a3bac8.tar.gz
glibc-71eb9cc1ffd79e96549dfb16f8e86aaf88a3bac8.tar.xz
glibc-71eb9cc1ffd79e96549dfb16f8e86aaf88a3bac8.zip
x86_64: Fix asm constraints in feraiseexcept (bug 30305)
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)
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r--sysdeps/x86_64/fpu/fraiseexcpt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/x86_64/fpu/fraiseexcpt.c b/sysdeps/x86_64/fpu/fraiseexcpt.c
index 44a1d93b34..a301b657c4 100644
--- a/sysdeps/x86_64/fpu/fraiseexcpt.c
+++ b/sysdeps/x86_64/fpu/fraiseexcpt.c
@@ -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;
     }