From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa2d.google.com (mail-vk1-xa2d.google.com [IPv6:2607:f8b0:4864:20::a2d]) by sourceware.org (Postfix) with ESMTPS id 3C94D385842B for ; Mon, 7 Feb 2022 14:58:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3C94D385842B Received: by mail-vk1-xa2d.google.com with SMTP id y192so7952700vkc.8 for ; Mon, 07 Feb 2022 06:58:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qAAQ/WuiYy8DEnvIFV3l7UZDB4xuS0c9NFH0iEod/Lo=; b=YZxlifbOY250xWro8/KT50lbveFnmQuYWMqsMU3i9+rOM/NDloomc53GZ6WlEtQOvf FGKEWzVUnHK/R0t9wfX7MXJ4ZDdCUEQcMxDWg17Qo3dQW9FHknNpAjB/5bgQHtKt74Qb f3S1uDg7UMRSYN7z4URuEbPZUyaYNVjbdYcIHa/459g+yAnHjIJxj4MYhK+nyews8gQx ocAwc1GCDoF+bPtY1fcmSgqw1GjptSiZ0HRc6vg8rh2V+Z0aUwptvJTHyfBd2Hacg4Qx X9WaCRriimtu+f1eSHnJIVU2180jb7VbfhwK88FlnsuyCPXw1zjwi5PYKCE7TXwy1Lhz j/bQ== X-Gm-Message-State: AOAM530HCR1UFTMnUzZCmwozIESuWplhZbZSPlXju+4MF2dt67NsUUqq AuRx2oQb9tqkSK8fzPkVbX3ARBhgdT6emdauhOI= X-Google-Smtp-Source: ABdhPJwCCgEnGsqXh1FxW2y3wji+RLM9YvkikYSXaakP/4ESxcCESxcq/AYSpD42ZCg7wooQ60/kobMQZh+Q0eiM6QE= X-Received: by 2002:a05:6122:990:: with SMTP id g16mr5181825vkd.3.1644245913768; Mon, 07 Feb 2022 06:58:33 -0800 (PST) MIME-Version: 1.0 References: <20220204165834.GI2646553@tucnak> <20220207132016.GX2646553@tucnak> In-Reply-To: <20220207132016.GX2646553@tucnak> From: David Edelsohn Date: Mon, 7 Feb 2022 09:58:22 -0500 Message-ID: Subject: Re: [PATCH] testsuite: Fix up testsuite/gcc.c-torture/execute/builtins/lib/chk.c for powerpc [PR104380] To: Jakub Jelinek Cc: Segher Boessenkool , Bill Schmidt , GCC Patches , Michael Meissner Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2022 14:58:36 -0000 On Mon, Feb 7, 2022 at 8:20 AM Jakub Jelinek wrote: > > On Fri, Feb 04, 2022 at 12:00:57PM -0500, David Edelsohn via Gcc-patches wrote: > > > The following testcase FAILs when configured with > > > --with-long-double-format=ieee . Only happens in the -std=c* modes, not the > > > GNU modes; while the glibc headers have __asm redirects of > > > vsnprintf and __vsnprinf_chk to __vsnprintfieee128 and > > > __vsnprintf_chkieee128, the vsnprintf fortification extern inline gnu_inline > > > always_inline wrapper calls __builtin_vsnprintf_chk and we actually emit > > > a call to __vsnprinf_chk (i.e. with IBM extended long double) instead of > > > __vsnprintf_chkieee128. > > > > > > rs6000_mangle_decl_assembler_name already had cases for *printf and *scanf, > > > so this just adds another case for *printf_chk. *scanf_chk doesn't exist. > > > __ prefixing isn't done because *printf_chk already starts with __. > > > > > > Bootstrapped/regtested on powerpc64le-linux, ok for trunk? > > > > Okay. > > Unfortunately, while I've tested the testcase also with -mabi=ieeelongdouble > by hand, the full bootstrap/regtest was on GCCFarm where glibc is too old > to test with --with-long-double-format=ieee. > I've done full bootstrap/regtest with that option during the weekend and > the patch regressed: > FAIL: gcc.c-torture/execute/builtins/snprintf-chk.c execution, -O1 > FAIL: gcc.c-torture/execute/builtins/snprintf-chk.c execution, -O2 > FAIL: gcc.c-torture/execute/builtins/snprintf-chk.c execution, -O2 -flto -fno-use-linker-plugin -flto-partition=none > FAIL: gcc.c-torture/execute/builtins/snprintf-chk.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects > FAIL: gcc.c-torture/execute/builtins/snprintf-chk.c execution, -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions > FAIL: gcc.c-torture/execute/builtins/snprintf-chk.c execution, -O3 -g > FAIL: gcc.c-torture/execute/builtins/snprintf-chk.c execution, -Og -g > FAIL: gcc.c-torture/execute/builtins/snprintf-chk.c execution, -Os > FAIL: gcc.c-torture/execute/builtins/sprintf-chk.c execution, -O1 > FAIL: gcc.c-torture/execute/builtins/sprintf-chk.c execution, -O2 > FAIL: gcc.c-torture/execute/builtins/sprintf-chk.c execution, -O2 -flto -fno-use-linker-plugin -flto-partition=none > FAIL: gcc.c-torture/execute/builtins/sprintf-chk.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects > FAIL: gcc.c-torture/execute/builtins/sprintf-chk.c execution, -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions > FAIL: gcc.c-torture/execute/builtins/sprintf-chk.c execution, -O3 -g > FAIL: gcc.c-torture/execute/builtins/sprintf-chk.c execution, -Og -g > FAIL: gcc.c-torture/execute/builtins/sprintf-chk.c execution, -Os > FAIL: gcc.c-torture/execute/builtins/vsnprintf-chk.c execution, -O1 > FAIL: gcc.c-torture/execute/builtins/vsnprintf-chk.c execution, -O2 > FAIL: gcc.c-torture/execute/builtins/vsnprintf-chk.c execution, -O2 -flto -fno-use-linker-plugin -flto-partition=none > FAIL: gcc.c-torture/execute/builtins/vsnprintf-chk.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects > FAIL: gcc.c-torture/execute/builtins/vsnprintf-chk.c execution, -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions > FAIL: gcc.c-torture/execute/builtins/vsnprintf-chk.c execution, -O3 -g > FAIL: gcc.c-torture/execute/builtins/vsnprintf-chk.c execution, -Og -g > FAIL: gcc.c-torture/execute/builtins/vsnprintf-chk.c execution, -Os > FAIL: gcc.c-torture/execute/builtins/vsprintf-chk.c execution, -O1 > FAIL: gcc.c-torture/execute/builtins/vsprintf-chk.c execution, -O2 > FAIL: gcc.c-torture/execute/builtins/vsprintf-chk.c execution, -O2 -flto -fno-use-linker-plugin -flto-partition=none > FAIL: gcc.c-torture/execute/builtins/vsprintf-chk.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects > FAIL: gcc.c-torture/execute/builtins/vsprintf-chk.c execution, -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions > FAIL: gcc.c-torture/execute/builtins/vsprintf-chk.c execution, -O3 -g > FAIL: gcc.c-torture/execute/builtins/vsprintf-chk.c execution, -Og -g > FAIL: gcc.c-torture/execute/builtins/vsprintf-chk.c execution, -Os > > The problem is that the execute/builtins/ testsuite wants to override some > of the library functions and with the change we (correctly) call > __*printf_chkieee128 and so lib/chk.c is no longer called but the glibc > APIs are. > > The following patch fixes it. > > Tested on powerpc64le-linux, ok for trunk? Okay. Thanks, David > > 2022-02-07 Jakub Jelinek > > PR target/104380 > * gcc.c-torture/execute/builtins/lib/chk.c (__sprintf_chkieee128, > __vsprintf_chkieee128, __snprintf_chkieee128, > __vsnprintf_chkieee128): New aliases to non-ieee128 suffixed functions > for powerpc -mabi=ieeelongdouble. > > --- gcc/testsuite/gcc.c-torture/execute/builtins/lib/chk.c.jj 2022-01-05 20:30:08.852805055 +0100 > +++ gcc/testsuite/gcc.c-torture/execute/builtins/lib/chk.c 2022-02-07 13:10:51.474447998 +0100 > @@ -517,3 +517,14 @@ vsnprintf (char *str, __SIZE_TYPE__ len, > return ret; > } > #endif > + > +#if defined(__powerpc__) && defined(__LONG_DOUBLE_IEEE128__) > +__typeof (__sprintf_chk) __sprintf_chkieee128 > + __attribute__((alias ("__sprintf_chk"))); > +__typeof (__vsprintf_chk) __vsprintf_chkieee128 > + __attribute__((alias ("__vsprintf_chk"))); > +__typeof (__snprintf_chk) __snprintf_chkieee128 > + __attribute__((alias ("__snprintf_chk"))); > +__typeof (__vsnprintf_chk) __vsnprintf_chkieee128 > + __attribute__((alias ("__vsnprintf_chk"))); > +#endif > > > Jakub >