From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7806) id 0515A3858D1E; Tue, 24 Jan 2023 19:24:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0515A3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674588261; bh=QdnLW5ONsaraRcmQHsYSrhukJio/EARRmhpVPIr1RpE=; h=From:To:Subject:Date:From; b=Fm0edFo50H1wWm4sGk/gfu6deuYLLlUAb/1hOCwbhxP60EH0/rw7Ymp7ngY2KNcK8 Kil9obv6ZvNGDowN9cDCoJLt7NNFCrD2JV68LDADZHD8QHWyLSexUDzae6mtXGn0kq /I1ba/ZvckBE7EO7drG/gziTx6PBDHsVwU6XdsfM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Stefan Schulze Frielinghaus To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5330] IBM zSystems: Fix TARGET_D_CPU_VERSIONS X-Act-Checkin: gcc X-Git-Author: Stefan Schulze Frielinghaus X-Git-Refname: refs/heads/master X-Git-Oldrev: 96fd01679011379d6da0777e435078212c6bb325 X-Git-Newrev: a4e725a10baf02c004c982772e22905fe99c1670 Message-Id: <20230124192421.0515A3858D1E@sourceware.org> Date: Tue, 24 Jan 2023 19:24:21 +0000 (GMT) List-Id: https://gcc.gnu.org/g:a4e725a10baf02c004c982772e22905fe99c1670 commit r13-5330-ga4e725a10baf02c004c982772e22905fe99c1670 Author: Stefan Schulze Frielinghaus Date: Tue Jan 24 20:23:07 2023 +0100 IBM zSystems: Fix TARGET_D_CPU_VERSIONS In the context of D the interpretation of S390, S390X, and SystemZ is a bit fuzzy. The wording S390X was wrongly deprecated in favour of SystemZ by commit https://github.com/dlang/dlang.org/commit/3b50a4c3faf01c32234d0ef8be5f82915a61c23f Thus, SystemZ is used for 64-bit targets, now, and S390 for 31-bit targets. However, in TARGET_D_CPU_VERSIONS depending on TARGET_ZARCH we set the CPU version to SystemZ. This is also the case if compiled for 31-bit targets leading to the following error: libphobos/libdruntime/core/sys/posix/sys/stat.d:967:13: error: static assert: '96u == 144u' is false 967 | static assert(stat_t.sizeof == 144); | ^ Thus in order to keep this patch simple I went for keeping SystemZ for 64-bit targets and S390, as usual, for 31-bit targets and dropped the distinction between ESA and z/Architecture. gcc/ChangeLog: * config/s390/s390-d.cc (s390_d_target_versions): Fix detection of CPU version. Diff: --- gcc/config/s390/s390-d.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/config/s390/s390-d.cc b/gcc/config/s390/s390-d.cc index d10b45f7de4..6e9c80f7283 100644 --- a/gcc/config/s390/s390-d.cc +++ b/gcc/config/s390/s390-d.cc @@ -30,10 +30,11 @@ along with GCC; see the file COPYING3. If not see void s390_d_target_versions (void) { - if (TARGET_ZARCH) - d_add_builtin_version ("SystemZ"); - else if (TARGET_64BIT) - d_add_builtin_version ("S390X"); + if (TARGET_64BIT) + { + d_add_builtin_version ("S390X"); + d_add_builtin_version ("SystemZ"); + } else d_add_builtin_version ("S390");