IBM zSystems: Fix TARGET_D_CPU_VERSIONS
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Tue, 24 Jan 2023 19:23:07 +0000 (20:23 +0100)
committerStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Tue, 24 Jan 2023 19:23:07 +0000 (20:23 +0100)
commita4e725a10baf02c004c982772e22905fe99c1670
treefeebb88c13ba48b0cbeadb8a328d3ded3982a08b
parent96fd01679011379d6da0777e435078212c6bb325
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.
gcc/config/s390/s390-d.cc