On Tue, Jan 04, 2022 at 12:07:49PM +0100, Jakub Jelinek wrote:
> On Mon, Jan 03, 2022 at 11:43:57PM +0100, Thomas Koenig wrote:
> > > clearly there is still work to fix (but seems e.g. most of the lto tests
> > > are related to the gnu attributes stuff:(  ).
> > 
> > This is looking better than what I expected.  Apart from LTO, I expect
> 
> I've just verified that LTO is broken even in C/C++, it isn't just gfortran.
> Just do
> make check-gcc RUNTESTFLAGS='--target_board=unix\{-mabi=ieeelongdouble\} 
> lto.exp'
> on a system where gcc is configured to default to -mabi=ibmlongdouble
> with glibc 2.32 or later and watch all the FAILs.
> All the failures look like:
> /home/jakub/gcc/obj/gcc/xgcc -B/home/jakub/gcc/obj/gcc/ c_lto_20081024_0.o 
> -mabi=ieeelongdouble -fdiagnostics-plain-output -O0 -flto 
> -flto-partition=none -o gcc-
> dg-lto-20081024-01.exe
> lto1: warning: Using IEEE extended precision 'long double' [-Wpsabi]
> FAIL: gcc.dg/lto/20081024 c_lto_20081024_0.o-c_lto_20081024_0.o link, -O0 
> -flto -flto-partition=none 
> 
> Michael, do you think you could have a look?  Either it is the ELF object
> created for debug info or the one created by lto1.

Here is the patch:

| From 22b778e6ea951774df921a2a49c0cf75a2b512a3 Mon Sep 17 00:00:00 2001
| From: Michael Meissner <meiss...@linux.ibm.com>
| Date: Wed, 5 Jan 2022 22:23:19 -0500
| Subject: [PATCH] Allow other languages to change long double format.

With Fortran adding support for changing the long double format, this
patch removes the code that only allowed C/C++ to change the long double
format for GLIBC 2.32 and later without a warning.

gcc/
2022-01-05  Michael Meissner  <meiss...@the-meissners.org>

        * config/rs6000/rs6000.c (rs6000_option_override_internal): Remove
        checks for only C/C++ front ends before allowing the long double
        format to change without a warning.
---
 gcc/config/rs6000/rs6000.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 319182e94d9..0e3481c8327 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4221,13 +4221,11 @@ rs6000_option_override_internal (bool global_init_p)
       if (rs6000_ieeequad != TARGET_IEEEQUAD_DEFAULT && TARGET_LONG_DOUBLE_128)
        {
          /* Determine if the user can change the default long double type at
-            compilation time.  Only C and C++ support this, and you need GLIBC
-            2.32 or newer.  Only issue one warning.  */
+            compilation time.  You need GLIBC 2.32 or newer to be able to
+            change the long double type.  Only issue one warning.  */
          static bool warned_change_long_double;
 
-         if (!warned_change_long_double
-             && (!glibc_supports_ieee_128bit ()
-                 || (!lang_GNU_C () && !lang_GNU_CXX ())))
+         if (!warned_change_long_double && !glibc_supports_ieee_128bit ())
            {
              warned_change_long_double = true;
              if (TARGET_IEEEQUAD)
-- 
2.33.1


-- 
Michael Meissner, IBM
PO Box 98, Ayer, Massachusetts, USA, 01432
email: meiss...@linux.ibm.com

Reply via email to