[v3,1/4] gdb, testsuite: handle icc and icpc deprecated remarks

Message ID 20230904222956.15203-2-abdul.b.ijaz@intel.com
State New
Headers
Series Dynamic properties of pointers |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Testing failed

Commit Message

Abdul Basit Ijaz Sept. 4, 2023, 10:29 p.m. UTC
  From: "Ijaz, Abdul B" <abdul.b.ijaz@intel.com>

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/ChangeLog:
2022-07-20  Nils-Christian Kempke  <nils-christian.kempke@intel.com>

	* lib/gdb.exp: Handle icc/icpc deprecation warnings.

2023-09-04 Nils-Christian Kempke <nils-christian.kempke@intel.com>
---
 gdb/testsuite/lib/gdb.exp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
  

Comments

Thiago Jung Bauermann Oct. 3, 2023, 12:04 a.m. UTC | #1
Hello,

Abdul Basit Ijaz via Gdb-patches <gdb-patches@sourceware.org> writes:

> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index 1b9179401c4..def6a75dfee 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -4980,13 +4980,15 @@ proc gdb_compile {source dest type options} {
>  	    }
>  	}
>  
> -	# 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.
> +	# 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.

I don't see any change in this comment except for the reformatting.
IMO, the text is more readable at the larger width and considering that
it's already less than 80 columns, I suggest dropping this part of the
change.

>  	if {([lsearch -exact $options c++] != -1
> -	     && [test_compiler_info {icc-20-21-[7-9]} c++])
> -	    || [test_compiler_info {icc-20-21-[7-9]}]} {
> +	     && [test_compiler_info {icc-20-21-[7-9]} c++]
> +	     && [test_compiler_info {icc-20-21-[1-9][0-9]} c++])

Unless I'm missing something, the above should be:

  ([lsearch …] != -1
   && ([test_compiler_info <pattern 1> c++]
       || [test_compiler_info <pattern 2> c++])

> +	    || [test_compiler_info {icc-20-21-[7-9]}]
> +	    || [test_compiler_info {icc-20-21-[1-9][0-9]}]} {
>  	    lappend new_options "additional_flags=-diag-disable=10441"
>  	}
>      }
  

Patch

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 1b9179401c4..def6a75dfee 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4980,13 +4980,15 @@  proc gdb_compile {source dest type options} {
 	    }
 	}
 
-	# 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.
+	# 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]}]} {
+	     && [test_compiler_info {icc-20-21-[7-9]} c++]
+	     && [test_compiler_info {icc-20-21-[1-9][0-9]} c++])
+	    || [test_compiler_info {icc-20-21-[7-9]}]
+	    || [test_compiler_info {icc-20-21-[1-9][0-9]}]} {
 	    lappend new_options "additional_flags=-diag-disable=10441"
 	}
     }