]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[gcn] Fix gfx906's sramecc setting
authorTobias Burnus <tburnus@baylibre.com>
Fri, 7 Feb 2025 09:44:18 +0000 (10:44 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Fri, 7 Feb 2025 09:44:18 +0000 (10:44 +0100)
When compiling with -g, mkoffload.cc creates a device object file itself;
however, in order that the linker dos not complain, the ELF flags must
match what the compiler / linker does. For gfx906, the assembler defaults
to sramecc = any, but gcn-devices.def contained unsupported, which is not
the same - causing link errors. That's a regression caused by commit
r15-4540-ga6b26e5ea09779 - which can be best seen by looking at the
changes to mkoffload.cc.

Additionally, this commit adds '...' to the GCN_DEVICE #define in gcn.cc
to make it agnostic to the addition of fields.

gcc/ChangeLog:

* config/gcn/gcn-devices.def (GCN_DEVICE): Change sramecc for
gfx906 to 'any'.
* config/gcn/gcn.cc (GCN_DEVICE): Add tailing ... to #define.

gcc/config/gcn/gcn-devices.def
gcc/config/gcn/gcn.cc

index 7d47a7b495d42e2fc8103380119ca7b9a53b347e..a8b21a358b4806f414cea629cbb708bd7c95c40d 100644 (file)
@@ -91,7 +91,7 @@ GCN_DEVICE(gfx900, GFX900, 0x2c, ISA_GCN5,
 
 GCN_DEVICE(gfx906, GFX906, 0x2f, ISA_GCN5,
           /* XNACK default */ HSACO_ATTR_OFF,
-          /* SRAM_ECC default */ HSACO_ATTR_UNSUPPORTED,
+          /* SRAM_ECC default */ HSACO_ATTR_ANY,
           /* WAVE64 mode */ HSACO_ATTR_UNSUPPORTED,
           /* CU mode */ HSACO_ATTR_UNSUPPORTED,
           /* Max ISA VGPRs */ 256,
index 4200cfaf0063eb05d0996527432e33aea6bf9dd3..82fc6ff1e4134194dce5af1b28de1fd5e67b23ef 100644 (file)
@@ -101,7 +101,8 @@ static hash_map<tree, int> lds_allocs;
 /* Import all the data from gcn-devices.def.
    The PROCESSOR_GFXnnn should be indices for this table.  */
 const struct gcn_device_def gcn_devices[] = {
-#define GCN_DEVICE(name, NAME, ELF, ISA, XNACK, SRAMECC, WAVE64, CU, VGPRS, GEN_VER,ARCH_FAM) \
+#define GCN_DEVICE(name, NAME, ELF, ISA, XNACK, SRAMECC, WAVE64, CU, VGPRS, \
+                  GEN_VER, ARCH_FAM, ...) \
     {PROCESSOR_ ## NAME, #name, #NAME, ISA, XNACK, SRAMECC, WAVE64, CU, VGPRS, \
      GEN_VER, #ARCH_FAM},
 #include "gcn-devices.def"