From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by sourceware.org (Postfix) with ESMTPS id F3FE03858D1E for ; Thu, 22 Dec 2022 20:24:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F3FE03858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671740673; x=1703276673; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=J00bmQh3emUxKhRxTovMo3E8yNIYgFTzO80qo7cyUJI=; b=GMiXNbwNCONLXu2IeJQA1gprkPCjONHFbvQ9Un3O2KcyXBYJxBnkHKJc xM9zZNK9lCx9PO82QuH/8kk1iSN800HoD79hQee78A5afVPiwtm6gK55x ZzOE42xhHdzer9BT7VHwcSHhZJd5YisPiyv7l3Ncp9LFuZfAzeW9aBODS /bNutJhl0CZolHIQzqU3iAcqryqPGh13mVXXHZ3wPUtPNCauWWEIAUZLs 90iqieByqp+cHtJ6vn+oUYXUV14Dkgy4s3eyJiRhJCFzSDIpTO6mYeBrC mRVY+V7wvSsjKrHN+eTBkt9LByzoLJj7s0tbM3UzCiOY1/5MHN63xsXRS g==; X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="347364665" X-IronPort-AV: E=Sophos;i="5.96,266,1665471600"; d="scan'208";a="347364665" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2022 12:24:31 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="653997883" X-IronPort-AV: E=Sophos;i="5.96,266,1665471600"; d="scan'208";a="653997883" Received: from ultl2604.iul.intel.com (HELO localhost) ([172.28.48.47]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2022 12:24:30 -0800 From: Tankut Baris Aktemur To: gdb-patches@sourceware.org Subject: [PATCH 1/2] testsuite: handle icc and icpc deprecated remarks Date: Thu, 22 Dec 2022 21:24:16 +0100 Message-Id: <20221222202417.2042422-1-tankut.baris.aktemur@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.5 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,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: From: Nils-Christian Kempke Starting with icc/icpc version 2021.7.0 and higher both compilers emit a deprecation remark when used. E.g. >> icc --version icc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '-diag-disable=10441' to disable this message. icc (ICC) 2021.7.0 20220713 Copyright (C) 1985-2022 Intel Corporation. All rights reserved. >> icpc --version icpc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated ... icpc (ICC) 2021.7.0 20220720 Copyright (C) 1985-2022 Intel Corporation. All rights reserved. As the testsuite compile fails when unexpected output by the compiler is seen this change in the compiler breaks all existing icc and icpc tests. This patch makes the gdb testsuite more forgiving by a) allowing the output of the remark when trying to figure out the compiler version and by b) adding '-diag-disable=10441' to the compile command whenever gdb_compile is called without the intention to detect the compiler. --- gdb/testsuite/lib/gdb.exp | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 132d538957c..39de114aab2 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4715,24 +4715,36 @@ proc gdb_compile {source dest type options} { set new_options [universal_compile_options] } - # Some C/C++ testcases unconditionally pass -Wno-foo as additional - # options to disable some warning. That is OK with GCC, because - # by design, GCC accepts any -Wno-foo option, even if it doesn't - # support -Wfoo. Clang however warns about unknown -Wno-foo by - # default, unless you pass -Wno-unknown-warning-option as well. - # We do that here, so that individual testcases don't have to - # worry about it. + # C/C++ specific settings. if {!$getting_compiler_info && [lsearch -exact $options rust] == -1 && [lsearch -exact $options ada] == -1 && [lsearch -exact $options f90] == -1 && [lsearch -exact $options go] == -1} { + + # Some C/C++ testcases unconditionally pass -Wno-foo as additional + # options to disable some warning. That is OK with GCC, because + # by design, GCC accepts any -Wno-foo option, even if it doesn't + # support -Wfoo. Clang however warns about unknown -Wno-foo by + # default, unless you pass -Wno-unknown-warning-option as well. + # We do that here, so that individual testcases don't have to + # worry about it. if {[test_compiler_info "clang-*"] || [test_compiler_info "icx-*"]} { lappend new_options "additional_flags=-Wno-unknown-warning-option" } elseif {[test_compiler_info "icc-*"]} { # This is the equivalent for the icc compiler. lappend new_options "additional_flags=-diag-disable=10148" } + + # Starting with 2021.7.0 (recognized as icc-20-21-7 by GDB) icc and + # icpc are marked as deprecated and both compilers emit the remark + # #10441. To let GDB still compile successfully, we disable these + # warnings here. + if {([lsearch -exact $options c++] != -1 + && [test_compiler_info {icc-20-21-[7-9]} c++]) + || [test_compiler_info {icc-20-21-[7-9]}]} { + lappend new_options "additional_flags=-diag-disable=10441" + } } # If the 'build-id' option is used, then ensure that we generate a @@ -5002,6 +5014,17 @@ proc gdb_compile {source dest type options} { # Prune uninteresting compiler (and linker) output. regsub "Creating library file: \[^\r\n\]*\[\r\n\]+" $result "" result + # Starting with 2021.7.0 icc and icpc are marked as deprecated and both + # compilers emit a remark #10441. To let GDB still compile successfully, + # we disable these warnings. When $getting_compiler_info is true however, + # we do not yet know the compiler (nor its version) and instead prune these + # lines from the compiler output to let the get_compiler_info pass. + if {$getting_compiler_info} { + regsub \ + "(icc|icpc): remark #10441: The Intel\\(R\\) C\\+\\+ Compiler Classic \\(ICC\\) is deprecated\[^\r\n\]*" \ + "$result" "" result + } + regsub "\[\r\n\]*$" "$result" "" result regsub "^\[\r\n\]*" "$result" "" result -- 2.25.1 Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928