public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-12] GCN: Restore build with GCC 4.8
@ 2022-10-17 12:24 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-10-17 12:24 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:38e4f4f55a6823d028b8f5332c500b7267ad320b

commit 38e4f4f55a6823d028b8f5332c500b7267ad320b
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Sat Oct 15 00:10:29 2022 +0200

    GCN: Restore build with GCC 4.8
    
    For example, for "g++-4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4", the recent
    commit r13-3220-g45381d6f9f4e7b5c7b062f5ad8cc9788091c2d07
    "amdgcn: add multiple vector sizes" broke the build:
    
        In file included from [...]/source-gcc/gcc/coretypes.h:458:0,
                         from [...]/source-gcc/gcc/config/gcn/gcn.cc:24:
        [...]/source-gcc/gcc/config/gcn/gcn.cc: In function ‘machine_mode VnMODE(int, machine_mode)’:
        ./insn-modes.h:42:71: error: temporary of non-literal type ‘scalar_int_mode’ in a constant expression
         #define QImode (scalar_int_mode ((scalar_int_mode::from_int) E_QImode))
                                                                               ^
        [...]/source-gcc/gcc/config/gcn/gcn.cc:405:10: note: in expansion of macro ‘QImode’
             case QImode:
                  ^
        In file included from [...]/source-gcc/gcc/coretypes.h:478:0,
                         from [...]/source-gcc/gcc/config/gcn/gcn.cc:24:
        [...]/source-gcc/gcc/machmode.h:410:7: note: ‘scalar_int_mode’ is not literal because:
         class scalar_int_mode
               ^
        [...]/source-gcc/gcc/machmode.h:410:7: note:   ‘scalar_int_mode’ is not an aggregate, does not have a trivial default constructor, and has no constexpr constructor that is not a copy or move constructor
        [...]
    
    Addressing this like simiar issues have been addressed in the past.
    
            gcc/
            * config/gcn/gcn.cc (VnMODE): Use 'case E_QImode:' instead of
            'case QImode:', etc.
    
    (cherry picked from commit 612de72b0d2904b5a5a2b487ce4cb907c768a947)

Diff:
---
 gcc/ChangeLog.omp     |  8 ++++++++
 gcc/config/gcn/gcn.cc | 14 +++++++-------
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index c34d0ec7c77..527a9850dba 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -1,3 +1,11 @@
+2022-10-17  Thomas Schwinge  <thomas@codesourcery.com>
+
+	Backported from master:
+	2022-10-17  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* config/gcn/gcn.cc (VnMODE): Use 'case E_QImode:' instead of
+	'case QImode:', etc.
+
 2022-10-14  Julian Brown  <julian@codesourcery.com>
 
 	* omp-low.cc (oacc_privatization_candidate_p): Artificial vars are not
diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc
index b01131c0dc2..9c2fd4c5b8a 100644
--- a/gcc/config/gcn/gcn.cc
+++ b/gcc/config/gcn/gcn.cc
@@ -412,7 +412,7 @@ VnMODE (int n, machine_mode mode)
 {
   switch (mode)
     {
-    case QImode:
+    case E_QImode:
       switch (n)
 	{
 	case 2: return V2QImode;
@@ -423,7 +423,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64QImode;
 	}
       break;
-    case HImode:
+    case E_HImode:
       switch (n)
 	{
 	case 2: return V2HImode;
@@ -434,7 +434,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64HImode;
 	}
       break;
-    case HFmode:
+    case E_HFmode:
       switch (n)
 	{
 	case 2: return V2HFmode;
@@ -445,7 +445,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64HFmode;
 	}
       break;
-    case SImode:
+    case E_SImode:
       switch (n)
 	{
 	case 2: return V2SImode;
@@ -456,7 +456,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64SImode;
 	}
       break;
-    case SFmode:
+    case E_SFmode:
       switch (n)
 	{
 	case 2: return V2SFmode;
@@ -467,7 +467,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64SFmode;
 	}
       break;
-    case DImode:
+    case E_DImode:
       switch (n)
 	{
 	case 2: return V2DImode;
@@ -478,7 +478,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64DImode;
 	}
       break;
-    case DFmode:
+    case E_DFmode:
       switch (n)
 	{
 	case 2: return V2DFmode;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-17 12:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 12:24 [gcc/devel/omp/gcc-12] GCN: Restore build with GCC 4.8 Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).