From: Juergen Christ Date: Fri, 1 Dec 2023 07:01:36 +0000 (+0100) Subject: s390x: Fix s390_md_asm_adjust handling of long doubles [PR112753] X-Git-Tag: basepoints/gcc-15~4099 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a2e428591dc97d573cf5c1789c84c8a3884b364;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc index 4b16a75f8518..0a969ec419e6 100644 --- a/gcc/config/s390/s390.cc +++ b/gcc/config/s390/s390.cc @@ -17605,6 +17605,10 @@ s390_md_asm_adjust (vec &outputs, vec &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 000000000000..7183b3f12bed --- /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)); }