From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by sourceware.org (Postfix) with ESMTPS id 8E6A93852778 for ; Mon, 18 Jul 2022 15:23:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8E6A93852778 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f49.google.com with SMTP id e15so12307022wro.5 for ; Mon, 18 Jul 2022 08:23:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oO/YcpCgS+tJOSMke9uWLav+szJB+EVC3nZb189G7ow=; b=XciwSyZIIK7VRq2xuvO6SL7LCjySAqAwPOyQrQYHIaCDVJrLI65J+vNiS+VDXkIOAB ut6aDIThPF8WwzP/fyfx5EstRm8rjTC0wvksRF5ZsFYgNK/YpsluWzwW1j3LIZSet0xK rjcNCfKv3b69PnF0Lom7XCQyeT+2VXkcUZOUGz1qV44yuS3X8UCmJn040PlcmjHgLJdd D+aAjqrneeffHq4vxjVZfNtjGuWAlf0XnXPYf69O7dDjU3zkmbYhikm52pzuWfG9OECM czYRD0EW9EUAVvvYHSTv5rVO2xCyihda+RRyMy0/6HcZhqm0NopT7R/cdjCmETq8Fwdi NtrQ== X-Gm-Message-State: AJIora8cjXd6bvYh5UEQAZQ0VWsUwq1WO7kODLoOgHYzp5YE4Er5tsZM l/49+pKIofGN4jtbeDT9Bq0= X-Google-Smtp-Source: AGRyM1v4LKI4HXBrflPLRy4y75Q4RE6e0bDeD9JQWGCYQs4h+Vb82d7aQpsKceKrhomUXBw5CrDlXQ== X-Received: by 2002:a5d:6d0d:0:b0:21d:7ae5:22ee with SMTP id e13-20020a5d6d0d000000b0021d7ae522eemr22130770wrq.152.1658157780477; Mon, 18 Jul 2022 08:23:00 -0700 (PDT) Received: from ?IPv6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id r8-20020a5d52c8000000b0021d65e9d449sm11658436wrv.73.2022.07.18.08.22.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Jul 2022 08:22:59 -0700 (PDT) Subject: Re: [PATCH] Add IEEE FLOAT128 support to test gdb.base/whatis-ptype-typedefs.exp To: Carl Love , "gdb-patches@sourceware.org" , Will Schmidt , Ulrich Weigand References: <3fe4fcaf067f3bc3d4124df3ed6ba009a174f933.camel@us.ibm.com> From: Pedro Alves Message-ID: <8ae117dd-17c2-382d-637a-64a3be7b185b@palves.net> Date: Mon, 18 Jul 2022 16:22:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <3fe4fcaf067f3bc3d4124df3ed6ba009a174f933.camel@us.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2022 15:23:03 -0000 On 2022-07-13 8:38 p.m., Carl Love via Gdb-patches wrote: > GCC enabled IEEE FLOAT 128-bit support starting with GCC 12 by default. > Previously long double was the default for 128-bit floating point support. > This patch updates the expected result for the "long doube" tests to > _Float128 if GCC 12 is used. The previous "long double" result is > expected for GCC 11 and older versions. This whole paragraph reads as if all archs were changed, but it was just Power, right? And isn't it the case that after the change, for GCC, "long double" _IS_ IEEE FLOAT 128-bit? Doesn't that mean that GCC and GDB now have a mismatch of what they think "long double" is? Like for example, if the user copies an expression from their program and evaluates in gdb, and that expression uses "long double", then GDB will evaluate it differently from how GCC would? Shouldn't GDB instead adjust its "long double" type depending on the ABI, mapping "long double" to the right format? And then, the testcase (probably) wouldn't change? BTW, I was expecting to see GCC's default change mentioned at: https://gcc.gnu.org/gcc-12/changes.html but I can't seem to find it there, other than a Fortran reference which seems related. I did find: https://gcc.gnu.org/wiki/Ieee128PowerPC#Transition > > The patch has been run on Power 7 (gcc version 4.8.5), Power 10 (gcc > version 12.1) and Intel x86_64 (gcc version 11.2.0) to verify the patch > fixes the 74 test failures on Power 10 with GCC 12 and does not introduce > any regression failures on older versions of GCC. Seems like x86 with gcc 12 would better be tested as well. > --- > .../gdb.base/whatis-ptype-typedefs.exp | 26 ++++++++++++++----- > 1 file changed, 20 insertions(+), 6 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp b/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp > index be76183ca79..a17084a19ec 100644 > --- a/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp > +++ b/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp > @@ -77,6 +77,12 @@ proc prepare {lang} { > # > # This can be "c" or "c++". > # > + > +# GCC 12 uses IEEE 128-bit floating point as the default starting with GCC 12. On all archs? > +# The table below consists of the compiler independent tests. The GCC version > +# specific tests are appended to the end of the table based on the compiler > +# version. > + > # Columns in the table represent: > # EXP # whatis # ptype # language > set table { > @@ -97,12 +103,6 @@ set table { > {"double_typedef2" "double_typedef" "double"} > {"v_double_typedef" "double_typedef" "double"} > {"v_double_typedef2" "double_typedef2" "double"} > - > - {"long_double_typedef" "long double" "long double"} > - {"long_double_typedef2" "long_double_typedef" "long double"} > - {"v_long_double_typedef" "long_double_typedef" "long double"} > - {"v_long_double_typedef2" "long_double_typedef2" "long double"} > - > {"colors_typedef" "(enum )?colors" "enum colors( : unsigned int)? {red, green, blue}"} > {"colors_typedef2" "colors_typedef" "enum colors( : unsigned int)? {red, green, blue}"} > {"v_colors_typedef" "colors_typedef" "enum colors( : unsigned int)? {red, green, blue}"} > @@ -151,6 +151,20 @@ set table { > "c++"} > } > > +# Add the long double tests on the version of GCC > +if { [test_compiler_info gcc-*] && [gcc_major_version] >= 12 } { What about x86 + gcc 12 ? > + lappend table {"long_double_typedef" "long double" "_Float128"} > + lappend table {"long_double_typedef2" "long_double_typedef" "_Float128"} > + lappend table {"v_long_double_typedef" "long_double_typedef" "_Float128"} > + lappend table {"v_long_double_typedef2" "long_double_typedef2" "_Float128"} > + > +} else { > + lappend table {"long_double_typedef" "long double" "long double"} > + lappend table {"long_double_typedef2" "long_double_typedef" "long double"} > + lappend table {"v_long_double_typedef" "long_double_typedef" "long double"} > + lappend table {"v_long_double_typedef2" "long_double_typedef2" "long double"} > +}