From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by sourceware.org (Postfix) with ESMTPS id BDFF73857C48 for ; Wed, 19 May 2021 12:56:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BDFF73857C48 IronPort-SDR: EY6dARheazgBt/pscXgIYjrLVONbwNZnkWojLrqI5bs5SillzpTGzAd4yDTCwRfQVHYTtdTGVA G10/b6lYN/Gw== X-IronPort-AV: E=McAfee;i="6200,9189,9988"; a="262195880" X-IronPort-AV: E=Sophos;i="5.82,312,1613462400"; d="scan'208";a="262195880" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 05:56:16 -0700 IronPort-SDR: 04VdTg+QtiEY/bXmgFMlFlTOqKO0z51OTVMaRv7WhPn+lNCY3aOMPk0O417lwwiB2pYU4u4agm 8kcLuI8uYdlA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,312,1613462400"; d="scan'208";a="439963038" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by orsmga008.jf.intel.com with ESMTP; 19 May 2021 05:56:15 -0700 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 14JCuEjb009175; Wed, 19 May 2021 13:56:14 +0100 Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id 14JCuEWI015647; Wed, 19 May 2021 14:56:14 +0200 Received: (from taktemur@localhost) by ulvlx001.iul.intel.com with LOCAL id 14JCuDwX015643; Wed, 19 May 2021 14:56:14 +0200 From: Tankut Baris Aktemur To: gdb-patches@sourceware.org Subject: [PATCH] testsuite/gdb.dwarf2: avoid dead code in dw2-inline-with-lexical-scope.c Date: Wed, 19 May 2021 14:56:00 +0200 Message-Id: <30668d9f3761a5c98cd7a596fbeb6e8a73fea818.1621428948.git.tankut.baris.aktemur@intel.com> X-Mailer: git-send-email 1.7.0.7 X-Spam-Status: No, score=-12.2 required=5.0 tests=AC_FROM_MANY_DOTS, BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2021 12:56:19 -0000 The test in gdb.dwarf2/dw2-inline-with-lexical-scope.c fails with icc. The reason is, icc did not emit code for a dead statement, which in turn caused some labels to be collapsed. Fix this by replacing the dead code with assignment to a global value. The statement itself does not change the test scenario. Also fix a whitespacing problem around an assignment operator. gdb/testsuite/ChangeLog: 2021-05-19 Tankut Baris Aktemur * gdb.dwarf2/dw2-inline-with-lexical-scope.c (func): Replace a dead code with an assignment to a global var. Fix a whitespacing problem around an assignment operator. --- gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.c b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.c index ef9b71af4e0..c5f42806a22 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.c @@ -30,14 +30,14 @@ static void func () { /* func prologue */ global_num = 42; - int num= 42; + int num = 42; if (num > 2) { asm ("scope_label1: .globl scope_label1"); global_value = num; int value = num; asm ("breakpoint_label: .globl breakpoint_label"); - value += 10; + global_value += value; asm ("scope_label2: .globl scope_label2"); } } /* func end */ -- 2.17.1