From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 33E623857011 for ; Mon, 5 Sep 2022 08:53:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 33E623857011 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2858qIPP012837; Mon, 5 Sep 2022 08:53:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=lz3BZGAXktvi+XfCaQZTcK0Vxf4gFUA0HbjMWwUv02Q=; b=fNOJxY8z85rxqTT5FwucnIzCy0YSmkduRl6HGKfr7dniR3g9KU2bgSfNeUe0Ziqwxiuf umgINmYXfQmCsmqBV7ImV8PnRoPmQbw3dozSlm9JHnXRinHQQawOMU9R14hWJ4bbBuTS adT/27adttGQEK311fbbfNt3xokOgpNzL9vBv99w+01BXxH+5F8Xi7tRHSy6whz6ijSg Y3vEWZWefZV4uoBCQSkD7F/bF63cs2kVZJfg5compA5pKYvhQYbAJ3DIDBBTtV05Gaof h1ozCPyGjdMu5wmf8UQ2gDlE0OO3YIspCC4oaJ2DB2OI7DSUCt7sAed/+3BiN3GW2osL Lw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jddyq00uk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Sep 2022 08:53:24 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2858qkRq015026; Mon, 5 Sep 2022 08:53:24 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jddyq00tm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Sep 2022 08:53:24 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2858q1NR014722; Mon, 5 Sep 2022 08:53:22 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma06ams.nl.ibm.com with ESMTP id 3jbx6hj6kg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Sep 2022 08:53:21 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2858rg7341877988 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Sep 2022 08:53:43 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A3527A405C; Mon, 5 Sep 2022 08:53:19 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AFE58A4054; Mon, 5 Sep 2022 08:53:17 +0000 (GMT) Received: from [9.200.35.246] (unknown [9.200.35.246]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 5 Sep 2022 08:53:17 +0000 (GMT) Message-ID: Date: Mon, 5 Sep 2022 16:53:15 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v2] rs6000/test: Fix empty TU in some cases of effective targets [PR106345] Content-Language: en-US To: Segher Boessenkool Cc: Peter Bergner , David Edelsohn , GCC Patches References: From: "Kewen.Lin" In-Reply-To: Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: i09dZrNjgijdizBPt0s0PkaIVqxEN2iz X-Proofpoint-ORIG-GUID: iJfE-J9xybXG77y99HLGiTlrj69SLW2m Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-09-05_05,2022-09-05_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 mlxscore=0 priorityscore=1501 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209050040 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,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: Hi Segher, Gentle ping this patch as you wanted empty TU issue to be fixed first at the discussion [1]. Thanks in advance for your time! [1] https://gcc.gnu.org/pipermail/gcc-patches/2022-September/600927.html BR, Kewen on 2022/7/25 14:26, Kewen.Lin via Gcc-patches wrote: > Hi, > > As the failure of test case gcc.target/powerpc/pr92398.p9-.c in > PR106345 shows, some test sources for some powerpc effective > targets use empty translation unit wrongly. The test sources > could go with options like "-ansi -pedantic-errors", then those > effective target checkings will fail unexpectedly with the > error messages like: > > error: ISO C forbids an empty translation unit [-Wpedantic] > > This patch is to fix empty TUs with one dummy function definition > accordingly. > > Excepting for the failures on gcc.target/powerpc/pr92398.p9-.c > fixed, I can see it helps to bring back some testing coverage like: > > NA->PASS: gcc.target/powerpc/pr92398.p9+.c > NA->PASS: gcc.target/powerpc/pr93453-1.c > > Tested as before. > > v1: https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598602.html > v2: Use dummy function instead of dummy int as Segher suggested. > > Segher, does this v2 look good to you? > > BR, > Kewen > ----- > PR testsuite/106345 > > gcc/testsuite/ChangeLog: > > * lib/target-supports.exp (check_effective_target_powerpc_sqrt): Add > a function definition to avoid pedwarn about empty translation unit. > (check_effective_target_has_arch_pwr5): Likewise. > (check_effective_target_has_arch_pwr6): Likewise. > (check_effective_target_has_arch_pwr7): Likewise. > (check_effective_target_has_arch_pwr8): Likewise. > (check_effective_target_has_arch_pwr9): Likewise. > (check_effective_target_has_arch_pwr10): Likewise. > (check_effective_target_has_arch_ppc64): Likewise. > (check_effective_target_ppc_float128): Likewise. > (check_effective_target_ppc_float128_insns): Likewise. > (check_effective_target_powerpc_vsx): Likewise. > --- > gcc/testsuite/lib/target-supports.exp | 33 +++++++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > > diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp > index 4ed7b25b9a4..06484330178 100644 > --- a/gcc/testsuite/lib/target-supports.exp > +++ b/gcc/testsuite/lib/target-supports.exp > @@ -6259,9 +6259,12 @@ proc check_effective_target_powerpc_sqrt { } { > } > > return [check_no_compiler_messages powerpc_sqrt object { > + void test (void) > + { > #ifndef _ARCH_PPCSQ > #error _ARCH_PPCSQ is not defined > #endif > + } > } {}] > } > > @@ -6369,71 +6372,92 @@ proc check_effective_target_powerpc_p9modulo_ok { } { > # as provided by the test. > proc check_effective_target_has_arch_pwr5 { } { > return [check_no_compiler_messages_nocache arch_pwr5 assembly { > + void test (void) > + { > #ifndef _ARCH_PWR5 > #error does not have power5 support. > #else > /* "has power5 support" */ > #endif > + } > } [current_compiler_flags]] > } > > proc check_effective_target_has_arch_pwr6 { } { > return [check_no_compiler_messages_nocache arch_pwr6 assembly { > + void test (void) > + { > #ifndef _ARCH_PWR6 > #error does not have power6 support. > #else > /* "has power6 support" */ > #endif > + } > } [current_compiler_flags]] > } > > proc check_effective_target_has_arch_pwr7 { } { > return [check_no_compiler_messages_nocache arch_pwr7 assembly { > + void test (void) > + { > #ifndef _ARCH_PWR7 > #error does not have power7 support. > #else > /* "has power7 support" */ > #endif > + } > } [current_compiler_flags]] > } > > proc check_effective_target_has_arch_pwr8 { } { > return [check_no_compiler_messages_nocache arch_pwr8 assembly { > + void test (void) > + { > #ifndef _ARCH_PWR8 > #error does not have power8 support. > #else > /* "has power8 support" */ > #endif > + } > } [current_compiler_flags]] > } > > proc check_effective_target_has_arch_pwr9 { } { > return [check_no_compiler_messages_nocache arch_pwr9 assembly { > + void test (void) > + { > #ifndef _ARCH_PWR9 > #error does not have power9 support. > #else > /* "has power9 support" */ > #endif > + } > } [current_compiler_flags]] > } > > proc check_effective_target_has_arch_pwr10 { } { > return [check_no_compiler_messages_nocache arch_pwr10 assembly { > + void test (void) > + { > #ifndef _ARCH_PWR10 > #error does not have power10 support. > #else > /* "has power10 support" */ > #endif > + } > } [current_compiler_flags]] > } > > proc check_effective_target_has_arch_ppc64 { } { > return [check_no_compiler_messages_nocache arch_ppc64 assembly { > + void test (void) > + { > #ifndef _ARCH_PPC64 > #error does not have ppc64 support. > #else > /* "has ppc64 support" */ > #endif > + } > } [current_compiler_flags]] > } > > @@ -6520,9 +6544,12 @@ proc check_effective_target_powerpc_float128_hw_ok { } { > > proc check_effective_target_ppc_float128 { } { > return [check_no_compiler_messages_nocache ppc_float128 object { > + void test (void) > + { > #ifndef __FLOAT128__ > nope no good > #endif > + } > }] > } > > @@ -6530,9 +6557,12 @@ proc check_effective_target_ppc_float128 { } { > > proc check_effective_target_ppc_float128_insns { } { > return [check_no_compiler_messages_nocache ppc_float128 object { > + void test (void) > + { > #ifndef __FLOAT128_HARDWARE__ > nope no good > #endif > + } > }] > } > > @@ -6540,9 +6570,12 @@ proc check_effective_target_ppc_float128_insns { } { > > proc check_effective_target_powerpc_vsx { } { > return [check_no_compiler_messages_nocache powerpc_vsx object { > + void test (void) > + { > #ifndef __VSX__ > nope no vsx > #endif > + } > }] > } > > -- > 2.32.0