public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tankut Baris Aktemur <aktemur@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] testsuite: handle icc and icpc deprecated remarks
Date: Mon,  9 Jan 2023 08:56:46 +0000 (GMT)	[thread overview]
Message-ID: <20230109085646.6CE9D3858D20@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0046ff60684eb16dcfafac350d37f4dc56c368e3

commit 0046ff60684eb16dcfafac350d37f4dc56c368e3
Author: Nils-Christian Kempke <nils-christian.kempke@intel.com>
Date:   Mon Jan 9 09:44:22 2023 +0100

    testsuite: handle icc and icpc deprecated remarks
    
    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.
    
    Approved-By: Tom Tromey <tom@tromey.com>

Diff:
---
 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 af538e5c8fb..44f11a982dd 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4690,24 +4690,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
@@ -4977,6 +4989,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

                 reply	other threads:[~2023-01-09  8:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230109085646.6CE9D3858D20@sourceware.org \
    --to=aktemur@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).