https://gcc.gnu.org/g:d89bfb6dc0a460ee16139a458fa5353b8f6ba804
commit d89bfb6dc0a460ee16139a458fa5353b8f6ba804 Author: Thomas Schwinge <tschwi...@baylibre.com> Date: Thu Dec 5 14:28:26 2024 +0100 GCN: Fix 'real_from_integer' usage The recent commit b3f1b9e2aa079f8ec73e3cb48143a16645c49566 "build: Remove INCLUDE_MEMORY [PR117737]" exposed an issue in code added in 2020 GCN back end commit 95607c12363712c39345e1d97f2c1aee8025e188 "Zero-initialise masked load destinations"; compilation now fails: [...] In file included from ../../source-gcc/gcc/coretypes.h:507:0, from ../../source-gcc/gcc/config/gcn/gcn.cc:24: ../../source-gcc/gcc/real.h: In instantiation of ‘format_helper::format_helper(const T&) [with T = std::nullptr_t]’: ../../source-gcc/gcc/config/gcn/gcn.cc:1178:46: required from here ../../source-gcc/gcc/real.h:233:17: error: no match for ‘operator==’ (operand types are ‘std::nullptr_t’ and ‘machine_mode’) : m_format (m == VOIDmode ? 0 : REAL_MODE_FORMAT (m)) ^ [...] That's with 'g++ (GCC) 5.5.0', and seen similarly with 'g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0', for example. gcc/ * config/gcn/gcn.cc (gcn_vec_constant): Fix 'real_from_integer' usage. (cherry picked from commit 91c503431f675bf3c94bd23c2b1deecdd2df52b8) Diff: --- gcc/ChangeLog.omp | 6 ++++++ gcc/config/gcn/gcn.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index 243c7864e571..913daacc67b4 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,5 +1,11 @@ 2024-12-18 Thomas Schwinge <tschwi...@baylibre.com> + Backported from trunk: + 2024-12-09 Thomas Schwinge <tschwi...@baylibre.com> + + * config/gcn/gcn.cc (gcn_vec_constant): Fix 'real_from_integer' + usage. + Backported from trunk: 2024-12-06 Thomas Schwinge <tschwi...@baylibre.com> diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc index e5fc05afbf86..49ab9cf3bd65 100644 --- a/gcc/config/gcn/gcn.cc +++ b/gcc/config/gcn/gcn.cc @@ -1199,7 +1199,7 @@ gcn_vec_constant (machine_mode mode, int a) if (FLOAT_MODE_P (innermode)) { REAL_VALUE_TYPE rv; - real_from_integer (&rv, NULL, a, SIGNED); + real_from_integer (&rv, VOIDmode, a, SIGNED); tem = const_double_from_real_value (rv, innermode); } else