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

Message ID 20230627210341.2516951-1-drc@linux.vnet.ibm.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] config/ppc: fix gcc "internal compiler error" message for p10 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

David Christensen June 27, 2023, 9:03 p.m. UTC
  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

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Tested-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>
---
v2:
 - Fixed spelling error in commit message
---
 config/ppc/meson.build | 8 ++++++++
 1 file changed, 8 insertions(+)

--
2.31.1
  

Comments

Thomas Monjalon June 27, 2023, 11:35 p.m. UTC | #1
27/06/2023 23:03, David Christensen:
> 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
> 
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> Tested-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>

Applied, thanks.

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

Patch

diff --git a/config/ppc/meson.build b/config/ppc/meson.build
index 1cba44011f..160b203cb1 100644
--- a/config/ppc/meson.build
+++ b/config/ppc/meson.build
@@ -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)