From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 0933D3858404 for ; Tue, 13 Feb 2024 10:27:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0933D3858404 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cebitec.uni-bielefeld.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0933D3858404 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=129.70.160.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707820037; cv=none; b=oWBeEqsI5zor7xOOUmPUaIRYrxcXjyNctFiuTp31Jnv7rdWLCYJMVujRcQY5+BhEw55wXfJ++7T7FXblA5hT3IIVKrnbAH9A26PA3loUtuVIAC8Vw6N67i983dwu6oCPiyMYanS5DqYXOY3ubQSGJs1SivibYMnj96hVexVNwpU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707820037; c=relaxed/simple; bh=9LFb9HPd4bABkPg1urEaFD6P47FjLAivBg7FL96TnHY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=l1pXylthIEcgk8qPn/eRICouX4MsUBdfCsBrIBeqdwFZSHpQHk2mOjtGDatY1xoFsoExlMgQPpmsQPCXATnBu66KniGqA5SZJLnL0WnNVvZO563EArCyFmV4VeBsGMhub7pviB6dz77gNlXg0kAdWLo6KEnZ6DthDMMkfSV2tc4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id B4F18C02D3; Tue, 13 Feb 2024 11:27:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= cebitec.uni-bielefeld.de; h=content-type:content-type :mime-version:user-agent:message-id:in-reply-to:date:date :references:subject:subject:from:from:received:received; s= 20200306; t=1707820032; bh=9LFb9HPd4bABkPg1urEaFD6P47FjLAivBg7FL 96TnHY=; b=IiqXkAzHMIxRLKyf4OuDPSqx8CbRU/tDB1HxssyNtMgUWiPbEcu1L 2Fke+Cl50m2HzgMaCE0x0GNmgUxUxNOlIhexrUJmOa+1g2TPl3LfSyoDOPodPDE+ /tCKMx1Zc3miiWRxypkWzJvcvnASWWv6vHss5Bhc8AWF0FE38p59V4ZrB6gnzKoq p7bkwbRaQAUWYSKwU01Qxg5T7F+22AwrWlo1uiPkuEH9WR4quQGYr02UpU8AezGG CbaSDwShozIoShcwHvG8RpD8yGJhXort7VpH34HqauPV1vz8+q6fa4UggBNRI9Jz 4Qfami5SJmmf1BUsD+EjbGR5OMnt1h+xA== X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id oJFj8XHmG32n; Tue, 13 Feb 2024 11:27:12 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p5085539e.dip0.t-ipconnect.de [80.133.83.158]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id E72A1C05A0; Tue, 13 Feb 2024 11:27:11 +0100 (CET) From: Rainer Orth To: Jason Merrill Cc: gcc-patches@gcc.gnu.org, "H.J. Lu" Subject: Re: [PATCH] testsuite: Fix c-c++-common/pr103798-2.c on Solaris [PR113706] References: Date: Tue, 13 Feb 2024 11:27:11 +0100 In-Reply-To: (Jason Merrill's message of "Mon, 12 Feb 2024 16:24:57 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Status: No, score=-3791.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Jason, > On 2/2/24 10:23, Rainer Orth wrote: >> c-c++-common/pr103798-2.c FAILs on Solaris when compiled as C++: >> FAIL: c-c++-common/pr103798-2.c -std=3Dgnu++14 scan-assembler-not memc= hr >> FAIL: c-c++-common/pr103798-2.c -std=3Dgnu++17 scan-assembler-not memc= hr >> FAIL: c-c++-common/pr103798-2.c -std=3Dgnu++20 scan-assembler-not memc= hr >> FAIL: c-c++-common/pr103798-2.c -std=3Dgnu++98 scan-assembler-not memc= hr >> As H.J. analyzed in the PR, Solaris declares std::memchr, not >> memchr, which isn't treated as __builtin_memchr. > > The problem seems to be not the std::, but that the Solaris string.h > declares > > const void *memchr(const void *, int, size_t); > > as specified by the C++ standard, while gcc expects the return type to be > void* like in C. > > This looks like a GCC bug, not Solaris; I'd prefer to xfail the testcase > rather than work around the compiler bug. thanks for the analysis. What I found with my current patch, just the memchr prototype changed to always return const void *, the test still PASSes as C, but FAILs as C++. In the C++ case I get a warning: /vol/gcc/src/hg/master/local/gcc/testsuite/c-c++-common/pr103798-2.c:10:20:= warning: declaration of =E2=80=98const void* memchr(const void*, int, size= _t)=E2=80=99 conflicts with built-in declaration =E2=80=98void* memchr(cons= t void*, int, unsigned int)=E2=80=99 [-Wbuiltin-declaration-mismatch] Here's the patch to xfail the test instead. Tested on sparc-sun-solaris2.11 and x86_64-pc-linux-gnu. Ok for trunk? Rainer --=20 ---------------------------------------------------------------------------= -- Rainer Orth, Center for Biotechnology, Bielefeld University 2024-02-12 Rainer Orth testsuite: PR tree-optimization/113706 * c-c++-common/pr103798-2.c (scan-assembler-not): xfail for C++ on Solaris. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=sol2-testsuite-pr103798-2.patch # HG changeset patch # Parent 1409f56e818a7240dd65da9566400f308a996beb testsuite: Fix c-c++-common/pr103798-2.c on Solaris [PR113706] diff --git a/gcc/testsuite/c-c++-common/pr103798-2.c b/gcc/testsuite/c-c++-common/pr103798-2.c --- a/gcc/testsuite/c-c++-common/pr103798-2.c +++ b/gcc/testsuite/c-c++-common/pr103798-2.c @@ -27,4 +27,5 @@ main () return 0; } -/* { dg-final { scan-assembler-not "memchr" } } */ +/* See PR tree-optimization/113706 for the xfail. */ +/* { dg-final { scan-assembler-not "memchr" { xfail { c++ && *-*-solaris2* } } } } */ --=-=-=--