From patchwork Wed Jul 10 08:44:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1958757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=I2/cTq/K; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WJrzW1JmYz1yNy for ; Wed, 10 Jul 2024 18:45:43 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2192138708B8 for ; Wed, 10 Jul 2024 08:45:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id B08E4387092A for ; Wed, 10 Jul 2024 08:45:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B08E4387092A 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 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B08E4387092A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720601111; cv=none; b=ovbnUTOkdhBPSoACMfAeQ9wju5FBhprnKOwWAiDJqWC/ZQGxQyuWOiGD3OupKwXFQvORgiACOoc+6sOh4BKQdSZU1pfZkzf8ViNorLDRE67U+EMn97420BDsagYTGfeJf5Iz91WL62nkMxZ+PYGPNaW3chVtpHcWsAHktdRoyNA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720601111; c=relaxed/simple; bh=XvigK4SFN+JrrQkBKQU4QFQP0ynKTBsmSxLYhYfm6rA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=PlNw5ZrWD3x1ekMlc31jueZMNcFX69dChjaf3RtFSu4UY5NcMPfr3GR901KkacLzClXWwTSRLRQr04SInKeMQRYMbtjV/Gz5thxx56W/Lhon17A8JJIII+dM4NH9vlj5dk/cJK2MvbTLa9fBg5fxWCXF5jKNpPVUmvs0GP+wFjo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46A8STOP014148; Wed, 10 Jul 2024 08:45:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h= message-id:date:mime-version:from:subject:to:cc:content-type :content-transfer-encoding; s=pp1; bh=FTpZbd7k5GxGSQbXqXHrd929pw mvJZLLEmvcnppYtIA=; b=I2/cTq/Ke/njk/mJT/fEx7SDp/ExD4h93va5BIH+Sf fnRhnamC4IZyJ7lUzsALJYABRdgomkpLFR2o+3qa+KvVLW6P9Elge16WX2+pF4KM x1M+OlM/zqFpuocvALFr1rMXHvSah8z6MDVzXVmh1ZR83jMbkB/OERahB98PUR6k //MoGjq0OzG2FCBsHTZ+fG429ZGPCpZfgi6fLWp2PqUfXqlp80O7+hsfkIpyQMDi y4eNwUfqRl5siHAGd+4LnY+h8M2rOGIC/IYBiJcMezuBYr2u+6dVkb6uxVgnr8+I 1QfKHmQx76j+vSFIS90JsnXqsN/J1P4CnAb97mDKDByw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 409ptn01fn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 08:45:08 +0000 (GMT) Received: from m0353727.ppops.net (m0353727.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 46A8j8xn006015; Wed, 10 Jul 2024 08:45:08 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 409ptn01fg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 08:45:08 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 46A7kxpY006896; Wed, 10 Jul 2024 08:45:07 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 407jfmhx6w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 08:45:07 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 46A8j1W555050584 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Jul 2024 08:45:03 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 188F02004F; Wed, 10 Jul 2024 08:45:01 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A0A9020043; Wed, 10 Jul 2024 08:44:59 +0000 (GMT) Received: from [9.200.158.244] (unknown [9.200.158.244]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 10 Jul 2024 08:44:59 +0000 (GMT) Message-ID: <1b6b1ba8-2134-1cd3-5a8a-4ce236224f54@linux.ibm.com> Date: Wed, 10 Jul 2024 16:44:58 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Content-Language: en-US From: "Kewen.Lin" Subject: [PATCH] rs6000: Update option set in rs6000_inner_target_options [PR115713] To: GCC Patches Cc: Segher Boessenkool , David Edelsohn , Michael Meissner , Peter Bergner X-TM-AS-GCONF: 00 X-Proofpoint-GUID: daf3zlx_EG7VpmTMUFJtkHm4-3RroWYE X-Proofpoint-ORIG-GUID: OvwxHqQHMuh5THnU5CwQuX54P9XMcsQN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_04,2024-07-09_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 phishscore=0 adultscore=0 clxscore=1015 bulkscore=0 suspectscore=0 mlxscore=0 priorityscore=1501 mlxlogscore=760 impostorscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407100057 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Hi, When function rs6000_inner_target_options parsing target options, it updates the explicit option set information for rs6000_opt_masks by rs6000_isa_flags_explicit, but it misses to update that information for rs6000_opt_vars, and it can result in some unexpected consequence as the associated test case shows. This patch is to fix rs6000_inner_target_options to update the option set for rs6000_opt_vars as well. Bootstrapped and regtested on powerpc64-linux-gnu P8/P9 and powerpc64le-linux-gnu P9 and P10. I'm going to push this next week if no objections. BR, Kewen ----- PR target/115713 gcc/ChangeLog: * config/rs6000/rs6000.cc (rs6000_inner_target_options): Update option set information for rs6000_opt_vars. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr115713-2.c: New test. --- gcc/config/rs6000/rs6000.cc | 3 ++- gcc/testsuite/gcc.target/powerpc/pr115713-2.c | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr115713-2.c -- 2.45.2 diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index ed7a9fdeb58..8647aa92fe9 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -24668,7 +24668,8 @@ rs6000_inner_target_options (tree args, bool attr_p) if (strcmp (r, rs6000_opt_vars[i].name) == 0) { size_t j = rs6000_opt_vars[i].global_offset; - *((int *) ((char *)&global_options + j)) = !invert; + *((int *) ((char *) &global_options + j)) = !invert; + *((int *) ((char *) &global_options_set + j)) = 1; error_p = false; not_valid_p = false; break; diff --git a/gcc/testsuite/gcc.target/powerpc/pr115713-2.c b/gcc/testsuite/gcc.target/powerpc/pr115713-2.c new file mode 100644 index 00000000000..47b39c0faba --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr115713-2.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* Force power7 to avoid possible error message on AltiVec ABI change. */ +/* { dg-options "-mdejagnu-cpu=power7" } */ + +/* Verify there is an error message for -mvsx incompatible with + -mavoid-indexed-addresses even when they are specified by + target attributes. */ + +int __attribute__ ((target ("avoid-indexed-addresses,vsx"))) +test1 (void) +{ + /* { dg-error "'-mvsx' and '-mavoid-indexed-addresses' are incompatible" "" { target *-*-* } .-1 } */ + return 0; +} + +int __attribute__ ((target ("vsx,avoid-indexed-addresses"))) +test2 (void) +{ + /* { dg-error "'-mvsx' and '-mavoid-indexed-addresses' are incompatible" "" { target *-*-* } .-1 } */ + return 0; +} +