aboutsummaryrefslogtreecommitdiff
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 15:34:06 +0200
commit95c5bddc9fbfda12220124dbf13750f97bae4e1d (patch)
tree4504756fb79f28ac508ec0d6787765d4b61fe4e3
parent6d42a86ad3861d6ec67058eb32f5150e7b734951 (diff)
downloadglibc-95c5bddc9fbfda12220124dbf13750f97bae4e1d.tar
glibc-95c5bddc9fbfda12220124dbf13750f97bae4e1d.tar.gz
glibc-95c5bddc9fbfda12220124dbf13750f97bae4e1d.tar.bz2
glibc-95c5bddc9fbfda12220124dbf13750f97bae4e1d.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)
-rw-r--r--NEWS1
-rw-r--r--sysdeps/x86_64/fpu/fraiseexcpt.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index bbe611c500..47690c3912 100644
--- a/NEWS
+++ b/NEWS
@@ -56,6 +56,7 @@ The following bugs are resolved with this release:
[29951] time: Set daylight to 1 for matching DST/offset change
[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
Version 2.36
diff --git a/sysdeps/x86_64/fpu/fraiseexcpt.c b/sysdeps/x86_64/fpu/fraiseexcpt.c
index 864f4777a2..23446ff4ac 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;
}