From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2135.outbound.protection.outlook.com [40.107.212.135]) by sourceware.org (Postfix) with ESMTPS id C6B033858D28 for ; Mon, 17 Oct 2022 14:49:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C6B033858D28 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=microsoft.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=microsoft.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GIOABUMN3euOSdWhVFVaYfgsRZlITj9LKk+dH2m4vs9ta+Wiu3vRqO5U01qYcGwFYuo4gWFlL8CNB13el2Au771/mGfgZYGqj51xvbFFgpVvfObJ4HkCYiTO7uP+ev2nFdoiy50rWCKCqxZl13hKCALn7NI6a7xMa3v9yQE9XlzdNozDF0zXcVmTkd50GpWFHF727A1aTKx3f4zxU6QSJ4CfvQaUHhQ0+XRdc4XY0ESjmMhtzepWWbL0M2o0JLlnJ8JAgAVDP/4ysk/z7C4m0O48po74yc/E7GAB3Z8KX3NKPI9u8ntWxKaZCV602wUaVmR8epSXbwYq5qes/gHYjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mTFPkVnjL84sGkdQk7FaEmv0bsu3GRG05QNA39oAg4E=; b=oUzC2s/HHUnP83dJZoLnSD0yMnUEH3RTmDMaSeiXky9f/A4c2OZkqkiRMXwNm5wY/7bvqPiJwROQYRZokR7u7mMivR45KF7K2OLpP2OJYgOrwsgdzs+GBUHDvKZsN/7Ozja63pUTVuRomZ43p2J5zJoEOZNLTX73+0Anl6dTKshoTFVdJZT8920pfg04wtrjim/KCqa+LV4Lbl/48zNvtOIuYi6Tj657AENZQdpWJISho6/7piMNZtWxqG/MyTmFX1XZPIIgu8g5puS/xOQaM3pHT4p9LkeXr+eCbilz5oG8vyTL2+Kp+8yF6bj+GyBg/eeDI5BJz6r6NRkGF/RjfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mTFPkVnjL84sGkdQk7FaEmv0bsu3GRG05QNA39oAg4E=; b=HP5ZIer76zHA1ZrKyfPYgxYe++BDosRpQxjjACpi6DejWM+OtN9g3VMZQUGFdNIRzivO6ef7r0QDqZGZxnjDTx4+2h90M65kaDzlARiHptm+VtPMilV4X1cB4/Xo3nd4M37a45VQKvTWCDFuiGsnnQXJi5jOhJJKZthIwyqmvAQ= Received: from CY5PR21MB3542.namprd21.prod.outlook.com (2603:10b6:930:d::7) by CO1PR21MB1313.namprd21.prod.outlook.com (2603:10b6:303:150::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.8; Mon, 17 Oct 2022 14:49:04 +0000 Received: from CY5PR21MB3542.namprd21.prod.outlook.com ([fe80::ff72:1a2:7c8:1b55]) by CY5PR21MB3542.namprd21.prod.outlook.com ([fe80::ff72:1a2:7c8:1b55%7]) with mapi id 15.20.5746.015; Mon, 17 Oct 2022 14:49:04 +0000 From: Eugene Rozenfeld To: Richard Biener CC: "gcc-patches@gcc.gnu.org" , Jason Merrill Subject: RE: [EXTERNAL] Re: [PATCH] Don't print discriminators for -fcompare-debug. Thread-Topic: [EXTERNAL] Re: [PATCH] Don't print discriminators for -fcompare-debug. Thread-Index: Adjg+x91bYI9Uh2kSX69tWF/1EUr3AA+7iSAAA/4JjA= Date: Mon, 17 Oct 2022 14:49:04 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=389f0ac3-3dba-46c2-834b-cb2808399be7;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-10-17T14:42:46Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CY5PR21MB3542:EE_|CO1PR21MB1313:EE_ x-ms-office365-filtering-correlation-id: 3afdacd9-18f2-487a-d41e-08dab04ebc97 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JS81oDqqxvnDHXBXV8lo6hJIbx1TGXmn/0l+5aXNSAM9yLz5ijswMBzNNEwX3Dgm0tFEv/Bchm5vOZKypYw4rwGRFfB0U6wlzcIb41JAbhukrX2KZHoZ0xDn6YI8r+FH+L/mGF6c7HhClIUHPhmB6fjSD/crPjyD/NFGAbHGXjLYX7b2tAMu2m1OdogbDAU6L3tjQQfmq/s/+ycP4PSOv+m5o0yMnsw5Mmi830tp2HsAbqR2kX9S0h9VCfNmR788N06nZ64Z9Cee+WBlMnxZ10Hh7SbT6kYlOZWpT7rd64OG5Rd01ziFG2I0h/XhD5jmafahyxunf4C5XMWjuZpo9sL9bWqTsALcwr+n4aDlwTOHRdDBQ5rtj21HYj2x9z34ZtvUrem61XAvLoOY7mHyEa1vHH7+Bt8QXLJWMJdhPzZ1y0AFfB6ryCl/KUyp1QgbCfPBdqrVhV+Mrxylj06WLAPk11OHLlpORuGFoOmzcIyAM8wR0sSFD7k2jOFjLurJArJTEFWGNZpVIy8VUWULSN1la8rPt+wbmP5mWc4dj51iQRe7HYt2/7o58yUQpSeAXb7Bv8ucpFxoyDdOrNo+E+F5m4AJ80psCOawUVIthpx+EFpiXDp10KzCRMxLo32kFSr7L8gIGvhCalHiV3Z5I7EMzj+2Pt/BipQInrhvhKrj+tOzjzRCh6X4bn3VOoPm/mEJ+v9lXbxu/4z2OWOhED7Z8PimLNsIJ45JSUdTnXrjjPR+QeRSNnIldqwFe/TtzkOkCXmtuqPFMtXoTrQFSy3OXQTUDuzq0lMeeH06JRhruQ4nTtf8Iydw02q9dkdVJdzSrXNB+MIxdqWE/15zog== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR21MB3542.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199015)(10290500003)(316002)(54906003)(83380400001)(122000001)(6916009)(966005)(2906002)(478600001)(41300700001)(6506007)(55016003)(5660300002)(53546011)(186003)(38070700005)(82960400001)(66946007)(86362001)(8936002)(52536014)(82950400001)(33656002)(38100700002)(76116006)(9686003)(7696005)(8676002)(8990500004)(4326008)(64756008)(66476007)(71200400001)(66446008)(66556008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?TfVT/UQ05ttpi8XVhh+2Fa+rM6KM1C5ZNlo2E3dwCKxpnNEWtHnM7xgrMQI3?= =?us-ascii?Q?sRalKxbfC7v5waJKJl4rWcIuiD746Cjxvm99j51ffAyu7X4yOGqL7rAsIq57?= =?us-ascii?Q?t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QNhmPVKECrNOzygqY3L?= =?us-ascii?Q?gPr6USGnttW2J8S2O21K7oiUZYTfY0GeCOKQY6wHuN+rxEztV+0lzQMR/kHq?= =?us-ascii?Q?E4XIzhE688MIrdrHsa8TIs+TcOZGTbC6urVzeHAtmstOvA4a7tbdKUIHG0jn?= =?us-ascii?Q?JdYJ1o/79mbAB+0rhqBgY28uAITvfsEvPiHllAAYYG1vzP9AM6LElDEkAXwo?= =?us-ascii?Q?siJMgEPGIzgNoiOgq9rX+mM5PU1OJ/wkoA9IgHojKt/cNZHkASnNMbOUJoIV?= =?us-ascii?Q?nw4PEkZ3z/9GdANINOYypxHMtRkzhgxXpstn5iPiMtlX9enGXLkc/tJLK2Sg?= =?us-ascii?Q?VUOWWl+E6UMm7Pxdq6+iz/mXObCl5pzuwQn8yB2L0NZ1kj0q5k+g3BPW3cJJ?= =?us-ascii?Q?0xDBMbZRlHP9V30m+DO29Nku341PKtSUFJ2wJxMqqd+fWT0ll4b22ig2BZSc?= =?us-ascii?Q?h4jhSiDVg68/pjEOre2JkudUr2IXmaNhV8GFSQzhaUs86D9qmECx+puhxpSL?= =?us-ascii?Q?Ef0Y/reRP8KTCZcqukJ0lDMz8/R9ZxOKwnOAhXiEWGhFua8HEhdMJ0VRWVKK?= =?us-ascii?Q?9UWz00zwgx5e8C1hQyufcn3wBWTugaBvEeiXyDghfQ7t6zQfeUXkC3rIxdj7?= =?us-ascii?Q?xAj6IRDwlvEjcEUoTtfAWD1ateggTN/VXdv2wvXLh4Oo?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY5PR21MB3542.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3afdacd9-18f2-487a-d41e-08dab04ebc97 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2022 14:49:04.4194 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZqjU42keq9ddUyUrQsZL8/fQFERo1ku7EMZ52MoOfebqkI+rexj+PAeel0m7YK28d8KxpMRZ792KFeIeqqgRzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR21MB1313 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,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 List-Id: Yes, -gstatement-frontiers is the root cause here but the new approach to d= iscriminators is especially prone to this. I added the workaround to pr8521= 3.c in my original discriminator patch but now two more -fcompare-debug bug= s were opened (PR107231 and PR107169). I suspect we'll keep getting more. S= o I'd like to disable printing discriminators in -fcompare-debug dums until= -gstatement-frontier issue is fixed. Eugene -----Original Message----- From: Richard Biener =20 Sent: Monday, October 17, 2022 12:06 AM To: Eugene Rozenfeld Cc: gcc-patches@gcc.gnu.org; Jason Merrill Subject: [EXTERNAL] Re: [PATCH] Don't print discriminators for -fcompare-de= bug. On Sun, Oct 16, 2022 at 10:25 PM Eugene Rozenfeld via Gcc-patches wrote: > > With -gstatement-frontiers we may end up with different IR coming from=20 > the front end with and without debug information turned on. > See https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fg= cc.gnu.org%2Fbugzilla%2Fshow_bug.cgi%3Fid%3D100733&data=3D05%7C01%7CEug= ene.Rozenfeld%40microsoft.com%7C5d3df88ec7e14f5eec2708dab00e0440%7C72f988bf= 86f141af91ab2d7cd011db47%7C1%7C0%7C638015871510301049%7CUnknown%7CTWFpbGZsb= 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C300= 0%7C%7C%7C&sdata=3D2JjQHAgDi6%2Fet1vowA1IRcdInJMkkjuva9DbM5rHawc%3D&= ;reserved=3D0 for details. > That may result in differences in discriminator values and=20 > -fcompare-debug failures. > > This patch disables printing of discriminators when the dump is=20 > intended for -fcompare-debug comparison and reverses the workaround in a = test. I don't think this is the correct approach. -gstatement-frontiers is known= to be prone to these issues and is the one to blame here. I think the bug= s should be SUSPENDED until -gstatement-frontiers is fixed or at least disa= bled by default (IIRC Jakub tried that but failed last time) > Tested on x86_64-pc-linux-gnu. > > gcc/ChangeLog: > PR debug/107231 > PR debug/107169 > * print-rtl.cc (print_rtx_operand_code_i): Don't print discrimina= tors > for -fdebug-compare. > > gcc/testsuite/ChangeLog: > > * c-c++-common/ubsan/pr85213.c: Reverse the workaround for discri= minators. > --- > gcc/print-rtl.cc | 13 ++++++++++--- > gcc/testsuite/c-c++-common/ubsan/pr85213.c | 7 +------ > 2 files changed, 11 insertions(+), 9 deletions(-) > > diff --git a/gcc/print-rtl.cc b/gcc/print-rtl.cc index=20 > e115f987173..0476f3d7e79 100644 > --- a/gcc/print-rtl.cc > +++ b/gcc/print-rtl.cc > @@ -453,10 +453,17 @@ rtx_writer::print_rtx_operand_code_i (const_rtx in_= rtx, int idx) > expanded_location xloc =3D insn_location (in_insn); > fprintf (m_outfile, " \"%s\":%i:%i", xloc.file, xloc.line, > xloc.column); > - int discriminator =3D insn_discriminator (in_insn); > - if (discriminator) > - fprintf (m_outfile, " discrim %d", discriminator); > > + /* Don't print discriminators for -fcompare-debug since the IR > + coming from the front end may be different with and without > + debug information turned on. That may result in different > + discriminator values. */ > + if (!(dump_flags & TDF_COMPARE_DEBUG)) > + { > + int discriminator =3D insn_discriminator (in_insn); > + if (discriminator) > + fprintf (m_outfile, " discrim %d", discriminator); > + } > } > #endif > } > diff --git a/gcc/testsuite/c-c++-common/ubsan/pr85213.c=20 > b/gcc/testsuite/c-c++-common/ubsan/pr85213.c > index e903e976f2c..8a6be81d20f 100644 > --- a/gcc/testsuite/c-c++-common/ubsan/pr85213.c > +++ b/gcc/testsuite/c-c++-common/ubsan/pr85213.c > @@ -1,11 +1,6 @@ > /* PR sanitizer/85213 */ > /* { dg-do compile } */ > -/* Pass -gno-statement-frontiers to work around > - https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fg= cc.gnu.org%2Fbugzilla%2Fshow_bug.cgi%3Fid%3D100733&data=3D05%7C01%7CEug= ene.Rozenfeld%40microsoft.com%7C5d3df88ec7e14f5eec2708dab00e0440%7C72f988bf= 86f141af91ab2d7cd011db47%7C1%7C0%7C638015871510301049%7CUnknown%7CTWFpbGZsb= 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C300= 0%7C%7C%7C&sdata=3D2JjQHAgDi6%2Fet1vowA1IRcdInJMkkjuva9DbM5rHawc%3D&= ;reserved=3D0 : > - without it the IR coming from the front end may be different with and= without > - debug information turned on. That may cause e.g., different discrimin= ator values > - and -fcompare-debug failures. */ > -/* { dg-options "-O1 -fsanitize=3Dundefined -fcompare-debug=20 > -gno-statement-frontiers" } */ > +/* { dg-options "-O1 -fsanitize=3Dundefined -fcompare-debug" } */ > > int > foo (int x) > -- > 2.25.1