aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJuergen Christ <jchrist@linux.ibm.com>2023-12-01 08:01:36 +0100
committerAndreas Krebbel <krebbel@linux.ibm.com>2023-12-01 08:17:15 +0100
commit8a2e428591dc97d573cf5c1789c84c8a3884b364 (patch)
tree2bab736d1c188c964ecefbe6202f532a229126db /gcc
parent28944a016bb5eef9a99691b3c55b124882375180 (diff)
downloadgcc-8a2e428591dc97d573cf5c1789c84c8a3884b364.zip
gcc-8a2e428591dc97d573cf5c1789c84c8a3884b364.tar.gz
gcc-8a2e428591dc97d573cf5c1789c84c8a3884b364.tar.bz2
s390x: Fix s390_md_asm_adjust handling of long doubles [PR112753]
Commit 466b100e5fee808d77598e0f294654deec281150 introduced a bug in s390_md_asm_adjust if vector extensions are not available. Fix the control flow of this function to not adjust long double values. gcc/ChangeLog: PR target/112753 * config/s390/s390.cc (s390_md_asm_adjust): Return after dealing with the outputs, if no further processing of long doubles is required. gcc/testsuite/ChangeLog: * gcc.target/s390/pr112753.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/s390/s390.cc4
-rw-r--r--gcc/testsuite/gcc.target/s390/pr112753.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc
index 4b16a75..0a969ec 100644
--- a/gcc/config/s390/s390.cc
+++ b/gcc/config/s390/s390.cc
@@ -17605,6 +17605,10 @@ s390_md_asm_adjust (vec<rtx> &outputs, vec<rtx> &inputs,
outputs[i] = fprx2;
}
+ if (!TARGET_VXE)
+ /* Long doubles are stored in FPR pairs - nothing left to do. */
+ return after_md_seq;
+
for (unsigned i = 0; i < ninputs; i++)
{
if (GET_MODE (inputs[i]) != TFmode)
diff --git a/gcc/testsuite/gcc.target/s390/pr112753.c b/gcc/testsuite/gcc.target/s390/pr112753.c
new file mode 100644
index 0000000..7183b3f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/pr112753.c
@@ -0,0 +1,8 @@
+/* This caused an ICE on s390x due to a bug in s390_md_asm_adjust when no
+ vector extension is available. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=zEC12" } */
+
+long double ____strtold_l_internal___x;
+void ____strtold_l_internal() { __asm__("" : : "fm"(____strtold_l_internal___x)); }