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 45ED3386F46F for ; Wed, 30 Sep 2020 11:21:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 45ED3386F46F Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08UBE3Iu048916; Wed, 30 Sep 2020 07:21:50 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33vry886e4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 07:21:50 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 08UBEnZx050241; Wed, 30 Sep 2020 07:21:49 -0400 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 33vry886df-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 07:21:49 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08UBHjhN014912; Wed, 30 Sep 2020 11:21:47 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma03fra.de.ibm.com with ESMTP id 33v5kg0hau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 11:21:47 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08UBLjNT30933326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Sep 2020 11:21:45 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E7EDC4204B; Wed, 30 Sep 2020 11:21:44 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 92EFB4203F; Wed, 30 Sep 2020 11:21:44 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.181.39]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 30 Sep 2020 11:21:44 +0000 (GMT) Date: Wed, 30 Sep 2020 13:21:44 +0200 From: Stefan Schulze Frielinghaus To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, Richard Biener , Richard Earnshaw , "Joseph S. Myers" Subject: Re: [PATCH] options: Save and restore opts_set for Optimization and Target options Message-ID: <20200930112144.GA97062@localhost.localdomain> References: <20200908084512.GH18149@tucnak> <20200911092952.GM18149@tucnak> <20200913082922.GF21814@tucnak> <20200928195000.GA6647@localhost.localdomain> <20200930093255.GK2176@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200930093255.GK2176@tucnak> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-30_06:2020-09-30, 2020-09-30 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 bulkscore=0 priorityscore=1501 phishscore=0 malwarescore=0 adultscore=0 mlxscore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009300089 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 30 Sep 2020 11:21:54 -0000 On Wed, Sep 30, 2020 at 11:32:55AM +0200, Jakub Jelinek wrote: > On Mon, Sep 28, 2020 at 09:50:00PM +0200, Stefan Schulze Frielinghaus via Gcc-patches wrote: > > This patch breaks quite a view test cases (target-attribute/tattr-*) on > > IBM Z. Having a look at function cl_target_option_restore reveals that > > some members of opts_set are reduced to 1 or 0 depending on whether a > > member was set before or not, e.g. for target_flags we have > > I've tried to reproduce the tattr FAILs reported in > https://gcc.gnu.org/pipermail/gcc-testresults/2020-September/608760.html > in a cross-compiler (with > #define HAVE_AS_MACHINE_MACHINEMODE 1 > ), but couldn't, neither the ICEs nor the scan-assembler failures. > Anyway, could you do a side-by-side debugging of one of those failures > before/after my change and see what behaves differently? I think the problem boils down that on S/390 we distinguish between four states of a flag: explicitely set to yes/no and implicitely set to yes/no. If set explicitely, the option wins. For example, the options `-march=z10 -mhtm` should enable the hardware transactional memory option although z10 does not have one. In the past if a flag was set or not explicitely was encoded into opts_set->x_target_flags ... for each flag individually, e.g. TARGET_OPT_HTM_P (opts_set->x_target_flags) was used. This has changed with the mentioned patch in the sense that opts_set encodes whether any flag of x_target_flags was set or not but not which individual one after a call to the generated function cl_target_option_restore where we have: opts_set->x_target_flags = (mask & 1) != 0; Compiling the following program #pragma GCC target ("arch=z10") void fn_pragma_0 (void) { } with options `-march=z13 -mzarch -mhtm -mdebug` produces different flags for 4ac7b669580 (commit prior your patch) and ba948b37768 (your patch). This is my current understanding of the option handling. I will try to come up with a trace where these things become hopefully more clear. Cheers, Stefan