Skip to contentSkip to conversation

config/ppc: fix gcc "internal compiler error" message for p10

PATCH Superseded David Christensen 2 participants 3 messages Jun 27, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 config/ppc: fix gcc "internal compiler error" message for p10

Building DPDK with gcc 11.3.x for the power10 instruction set may generate the following error:

../drivers/mempool/cnxk/cnxk_mempool_ops.c
during RTL pass: final ../drivers/mempool/cnxk/cnxk_mempool_ops.c:
In function ‘cnxk_mempool_alloc’:
../drivers/mempool/cnxk/cnxk_mempool_ops.c:124:1:
internal compiler error: output_operand: invalid expression as operand 124 | }

      | ^

Please submit a full bug report,
with preprocessed source if appropriate.
...
ninja: build stopped: subcommand failed.

The same issue is not encoutered when building with gcc 11.4 or later, where the compiler automatically adds the option "-mno-block-ops-vector-pair" when building for power10 which is intended as a code optimization and also effectively avoids the compiler bug displayed.

Modify the meson.build file for ppc and manually set the flag when building for power10 with gcc less than 11.4.

Bugzilla ID: 1251

---
 config/ppc/meson.build | 8 ++++++++
 1 file changed, 8 insertions(+)
config/ppc/meson.build +8 -0
index 1cba44011f..160b203cb1 100644
@@ -105,6 +105,14 @@ else
     endif
 endif
 machine_args = ['-mcpu=' + cpu_instruction_set, '-mtune=' + cpu_instruction_set]
+
+# gcc versions < 11.4 may fail to build for power10, see https://bugs.dpdk.org/show_bug.cgi?id=1251.
+# Explicitly specify a default used in gcc 11.4 and later to workaround the issue
+if (cpu_instruction_set == 'power10' and cc.get_id() == 'gcc' and
+        cc.version().version_compare('<=11.4'))
+    machine_args += '-mno-block-ops-vector-pair'
+endif
+
 dpdk_conf.set('RTE_MACHINE', cpu_instruction_set)
 
 
Signature · 1 line
2.31.1
#1 lore raw

PATCH v2 1/1 config/ppc: fix gcc "internal compiler error" message for p10

Building DPDK with gcc 11.3.x for the power10 instruction set may generate the following error:

../drivers/mempool/cnxk/cnxk_mempool_ops.c
during RTL pass: final ../drivers/mempool/cnxk/cnxk_mempool_ops.c:
In function ‘cnxk_mempool_alloc’:
../drivers/mempool/cnxk/cnxk_mempool_ops.c:124:1:
internal compiler error: output_operand: invalid expression as operand 124 | }

      | ^

Please submit a full bug report,
with preprocessed source if appropriate.
...
ninja: build stopped: subcommand failed.

The same issue is not encountered when building with gcc 11.4 or later, where the compiler automatically adds the option "-mno-block-ops-vector-pair" when building for power10 which is intended as a code optimization and also effectively avoids the compiler bug displayed.

Modify the meson.build file for ppc and manually set the flag when building for power10 with gcc less than 11.4.

Bugzilla ID: 1251

---
v2:
- Fixed spelling error in commit message

---
 config/ppc/meson.build | 8 ++++++++
 1 file changed, 8 insertions(+)
config/ppc/meson.build +8 -0
index 1cba44011f..160b203cb1 100644
@@ -105,6 +105,14 @@ else
     endif
 endif
 machine_args = ['-mcpu=' + cpu_instruction_set, '-mtune=' + cpu_instruction_set]
+
+# gcc versions < 11.4 may fail to build for power10, see https://bugs.dpdk.org/show_bug.cgi?id=1251.
+# Explicitly specify a default used in gcc 11.4 and later to workaround the issue
+if (cpu_instruction_set == 'power10' and cc.get_id() == 'gcc' and
+        cc.version().version_compare('<=11.4'))
+    machine_args += '-mno-block-ops-vector-pair'
+endif
+
 dpdk_conf.set('RTE_MACHINE', cpu_instruction_set)
 
 

--
2.31.1

#2 lore raw

27/06/2023 23:03, David Christensen:

Quoted 22 lines

Building DPDK with gcc 11.3.x for the power10 instruction set may generate the following error:

../drivers/mempool/cnxk/cnxk_mempool_ops.c
during RTL pass: final ../drivers/mempool/cnxk/cnxk_mempool_ops.c:
In function ‘cnxk_mempool_alloc’:
../drivers/mempool/cnxk/cnxk_mempool_ops.c:124:1:
internal compiler error: output_operand: invalid expression as operand 124 | }

      | ^

Please submit a full bug report,
with preprocessed source if appropriate.
...
ninja: build stopped: subcommand failed.

The same issue is not encountered when building with gcc 11.4 or later, where the compiler automatically adds the option "-mno-block-ops-vector-pair" when building for power10 which is intended as a code optimization and also effectively avoids the compiler bug displayed.

Quoted 7 lines

Modify the meson.build file for ppc and manually set the flag when building for power10 with gcc less than 11.4.

Bugzilla ID: 1251

Applied, thanks.

Note: IBM POWER support is still marked as alpha.
Would you like to work on its status?