From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id FXjMKst1emIAdAUAWB0awg (envelope-from ) for ; Tue, 10 May 2022 10:25:15 -0400 Received: by simark.ca (Postfix, from userid 112) id 9F43D1E21F; Tue, 10 May 2022 10:25:15 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=J80ZVn0u; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D543A1E01D for ; Tue, 10 May 2022 10:25:13 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0B8A53953834 for ; Tue, 10 May 2022 14:25:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B8A53953834 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652192713; bh=qz18wIs1+HB/37hxhc1pSRsNNd39bqifALDEjfr/Y/w=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=J80ZVn0uOgj1lla7MidXciNEZsxUqXuXVBzPBdZtGiYkdRUHpjflTy+rUZZ8N13ex qkgBIUYfKuSa0feWxWMplcoSgQImgWyMHnlE8AVBU4OGK1LzadTl/w9ku6CBY/DUmP 9j1ypMvyDiCO6bnE6f9Y2R5HIZY6f44sxek1+LDU= Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by sourceware.org (Postfix) with ESMTPS id D7015389FC37 for ; Tue, 10 May 2022 14:24:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D7015389FC37 X-IronPort-AV: E=McAfee;i="6400,9594,10342"; a="269523746" X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="269523746" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 07:24:48 -0700 X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="541797570" Received: from labpcdell3650-003.iul.intel.com (HELO localhost) ([172.28.49.87]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 07:24:46 -0700 To: gdb-patches@sourceware.org Subject: [PATCH 00/18] Fortran compiler identification and ifx testsuite support Date: Tue, 10 May 2022 16:24:19 +0200 Message-Id: <20220510142437.1397399-1-nils-christian.kempke@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-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: , From: Nils-Christian Kempke via Gdb-patches Reply-To: Nils-Christian Kempke Cc: JiniSusan.George@amd.com, aburgess@redhat.com Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi all, this series is a collection of patches we have prepared that was targeted at improving the overall passrate of the Intel ifx compiler within the Fortran testsuite. It also includes a new way for the testsuite to identify the Fortran compilers and their version. There are a few places in the gdb.fortran part of the testsuite that needed to be adapted for ifx. Some of these changes make the testsuite a bit less taylored to the gfortran specifics. Some of the changes fix flags and such to better support running the testsuite with ifx. While doing this and after initially submitting a patch here https://sourceware.org/pipermail/gdb-patches/2021-December/184612.html and in the follow-up discussion here https://sourceware.org/pipermail/gdb-patches/2022-January/185064.html we decided to change the testsuite a bit more and add a Frotran specific compiler identification to the Fortran testsuite. Generally, the procedures test_compiler_info and get_compiler_info are used in the testsuite to detect a certain compiler (e.g. gcc-*). This info is then used to set certain flags/kfails etc. The procedure get_compiler_info would, upon calling it, take the files compiler.c/compiler.cc (depending on wether or not the c++ option was passed to them) and run them through the respective C/CXX preprocessors of the compiler given via CC_FOR_TARGET/CXX_FOR_TARGET (or gcc/gfortran if these were not set). It would detect compiler specific macro definitions and retrun the compiler used, as well as its version in a string. As there was no separate option available for Fortran, using get_compiler_info inside a Fortran test would always default to the C compiler detection and return the version and name of the C compiler defined in CC_FOR_TARGET (or gcc if none was set). This meant, that running the testsuite while defining a F90_FOR_TARGET would, in order to set the right flags and kfails within the testsuite run, require one to also set the CC_FOR_TARGET to the C compiler that would 'correspond' to the Fortran one. So F90_FOR_TARGET=ifx would require CC_FOR_TARGET=icx, flang would require clang and so on. Running the Fortran testsuite with only F90_FOR_TARGET=ifx would be the equivalent of setting CC_FOR_TARGET=gcc. The test_compiler_info would return gcc-* in this case and compiler specific settings not be applied. Especially, this made it impossible to run heterogenous combinations of C and Fortran compilers and still have all flags/kfails setup correctly. In order to improve this (and the rest of our patches are base on this) we added a new option to get/test_compiler_info: 'f90'. We added a Fortran compiler identification mechanism similar to the existing C/CXX ones by adding the file compiler.F90. Similar to C/CXX, the Fortran compiler detection preprocesses the compiler.F90 file and, depending on the macros defined by the compiler, will return the Fortran compiler name and version. We want to note here, that preprocessing is not part of the Fortran standard. It was used here as it seems to be common for most compilers to have this feature in place (in fact, we don't know of any modern Fortran compilers that don't have it). We added detection for gfortran, ifx, ifort, classic flang, llvm flang, and armflang. While we tested the detection for all compilers with their latest available versions, we could not test the armflang compiler identification. We would kindly ask someone from arm (and I'll cc someone in this patch who I've written mails with before) to test these detection changes for us. They were extracted from the latest online armflang documentation. At last, when adding the Fortran compiler identification we were faced with the problem of properly maintaining F77_FOR_TARGET. We think, this feature is not maintained anymore and the last usage of it was removed many years ago. Thus, we decided to remove F77_FOR_TARGET from the testsuite. All these changes were tested for regressions on a x86_64 Ubunut20.04 machine running the boards unix, unix/-m32, native-gdbserver, and native-extended-gdbserver (-m32 is acually only properly supported for gfortran and ifort as far as we know). This series did not show any regressions but imporves the testsuite support for ifx significantly (in some places also for ifort and flang). We're looking forward to feedback! Cheers, Nils Abdul Basit Ijaz (1): gdb/testsuite: Use -module option for Intel Fortran compilers Cristian Sandu (1): gdb/testsuite: add Fortran compiler identification to GDB Felix Willgerodt (1): gdb/testsuite: Fix fortran types for Intel compilers. Nils-Christian Kempke (15): gdb/testsuite: remove F77_FOR_TARGET support gdb/testsuite: add local variable for passing 'getting_compiler_info' to gdb_compile gdb/testsuite: rename intel next gen c/cpp compilers gdb/testsuite: disable charset.exp for intel compilers testsuite, fortran: make print-formatted.exp more robust testsuite, fortran: add required external keyword testsuite, fortran: add compiler dependent types to dynamic-ptype-whatis testsuite, fortran: Add '-debug-parameters all' when compiling with ifx testsuite/lib: add check_optional_entry for GDBInfoSymbols testsuite, fortran: fix info-types for intel compilers testsuite, fortran: Add type info of formal parameter for Intel compilers. testsuite, fortran: allow additional completions in module.exp gdb, testsuite, fortran: fix double free in mixed-lang-stack.exp gdb, testsuite, fortran: fixup mixed-lang-stack for Intel/LLVM compilers gdb/testsuite: fixup common-block.exp for intel compilers gdb/testsuite/boards/cc-with-tweaks.exp | 5 - gdb/testsuite/boards/debug-types.exp | 1 - gdb/testsuite/boards/gold-gdb-index.exp | 1 - gdb/testsuite/gdb.fortran/assumedrank.exp | 6 +- gdb/testsuite/gdb.fortran/charset.exp | 5 + .../gdb.fortran/class-allocatable-array.exp | 4 +- gdb/testsuite/gdb.fortran/common-block.exp | 38 ++++++- .../gdb.fortran/derived-type-striding.exp | 2 +- .../gdb.fortran/dynamic-ptype-whatis.exp | 79 +++++++------- gdb/testsuite/gdb.fortran/function-calls.f90 | 1 + gdb/testsuite/gdb.fortran/info-types.exp | 10 +- gdb/testsuite/gdb.fortran/library-module.exp | 2 +- .../gdb.fortran/mixed-lang-stack.cpp | 12 +-- .../gdb.fortran/mixed-lang-stack.exp | 21 ++-- gdb/testsuite/gdb.fortran/module.exp | 5 +- gdb/testsuite/gdb.fortran/namelist.exp | 2 +- gdb/testsuite/gdb.fortran/nested-funcs-2.exp | 3 +- gdb/testsuite/gdb.fortran/print-formatted.exp | 3 +- gdb/testsuite/gdb.fortran/print-formatted.f90 | 1 + .../gdb.fortran/ptype-on-functions.exp | 12 ++- gdb/testsuite/gdb.fortran/vla-type.exp | 2 +- gdb/testsuite/lib/compiler.F90 | 69 ++++++++++++ gdb/testsuite/lib/compiler.c | 2 +- gdb/testsuite/lib/compiler.cc | 2 +- gdb/testsuite/lib/fortran.exp | 100 +++++++++++------- gdb/testsuite/lib/future.exp | 21 +--- gdb/testsuite/lib/gdb.exp | 61 +++++++---- gdb/testsuite/lib/sym-info-cmds.exp | 18 +++- 28 files changed, 317 insertions(+), 171 deletions(-) create mode 100644 gdb/testsuite/lib/compiler.F90 -- 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