[08/12] net/qede/base: fix build with GCC 12
Checks
Commit Message
GCC raises the following warning:
In function ‘_mm256_storeu_si256’,
inlined from ‘rte_mov32’ at
../lib/eal/x86/include/rte_memcpy.h:320:2,
inlined from ‘rte_mov128’ at
../lib/eal/x86/include/rte_memcpy.h:342:2,
inlined from ‘rte_memcpy_generic’ at
../lib/eal/x86/include/rte_memcpy.h:438:4,
inlined from ‘rte_memcpy’ at
../lib/eal/x86/include/rte_memcpy.h:882:10,
inlined from ‘__ecore_mcp_cmd_and_union’ at
../drivers/net/qede/base/ecore_mcp.c:541:3,
inlined from ‘_ecore_mcp_cmd_and_union’ at
../drivers/net/qede/base/ecore_mcp.c:638:2,
inlined from ‘ecore_mcp_cmd_and_union’ at
../drivers/net/qede/base/ecore_mcp.c:742:9:
/usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error:
array subscript 1 is outside array bounds of
‘union drv_union_data[1]’ [-Werror=array-bounds]
935 | *__P = __A;
| ~~~~~^~~~~
../drivers/net/qede/base/ecore_mcp.c: In function
‘ecore_mcp_cmd_and_union’:
../drivers/net/qede/base/ecore_mcp.c:533:30: note: at offset 32 into
object ‘union_data’ of size 32
533 | union drv_union_data union_data;
| ^~~~~~~~~~
Since this code is in the base driver, waive the check until the base
driver is fixed by the relevant people.
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/net/qede/base/meson.build | 5 +++++
1 file changed, 5 insertions(+)
Comments
On Wed, 18 May 2022 12:16:53 +0200
David Marchand <david.marchand@redhat.com> wrote:
> GCC raises the following warning:
>
> In function ‘_mm256_storeu_si256’,
> inlined from ‘rte_mov32’ at
> ../lib/eal/x86/include/rte_memcpy.h:320:2,
> inlined from ‘rte_mov128’ at
> ../lib/eal/x86/include/rte_memcpy.h:342:2,
> inlined from ‘rte_memcpy_generic’ at
> ../lib/eal/x86/include/rte_memcpy.h:438:4,
> inlined from ‘rte_memcpy’ at
> ../lib/eal/x86/include/rte_memcpy.h:882:10,
> inlined from ‘__ecore_mcp_cmd_and_union’ at
> ../drivers/net/qede/base/ecore_mcp.c:541:3,
> inlined from ‘_ecore_mcp_cmd_and_union’ at
> ../drivers/net/qede/base/ecore_mcp.c:638:2,
> inlined from ‘ecore_mcp_cmd_and_union’ at
> ../drivers/net/qede/base/ecore_mcp.c:742:9:
> /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error:
> array subscript 1 is outside array bounds of
> ‘union drv_union_data[1]’ [-Werror=array-bounds]
> 935 | *__P = __A;
> | ~~~~~^~~~~
> ../drivers/net/qede/base/ecore_mcp.c: In function
> ‘ecore_mcp_cmd_and_union’:
> ../drivers/net/qede/base/ecore_mcp.c:533:30: note: at offset 32 into
> object ‘union_data’ of size 32
> 533 | union drv_union_data union_data;
> | ^~~~~~~~~~
>
> Since this code is in the base driver, waive the check until the base
> driver is fixed by the relevant people.
>
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Or mark driver broken with gcc-12 and get the maintainer to fix?
On Wed, 18 May 2022 12:16:53 +0200
David Marchand <david.marchand@redhat.com> wrote:
> GCC raises the following warning:
>
> In function ‘_mm256_storeu_si256’,
> inlined from ‘rte_mov32’ at
> ../lib/eal/x86/include/rte_memcpy.h:320:2,
> inlined from ‘rte_mov128’ at
> ../lib/eal/x86/include/rte_memcpy.h:342:2,
> inlined from ‘rte_memcpy_generic’ at
> ../lib/eal/x86/include/rte_memcpy.h:438:4,
> inlined from ‘rte_memcpy’ at
> ../lib/eal/x86/include/rte_memcpy.h:882:10,
> inlined from ‘__ecore_mcp_cmd_and_union’ at
> ../drivers/net/qede/base/ecore_mcp.c:541:3,
> inlined from ‘_ecore_mcp_cmd_and_union’ at
> ../drivers/net/qede/base/ecore_mcp.c:638:2,
> inlined from ‘ecore_mcp_cmd_and_union’ at
> ../drivers/net/qede/base/ecore_mcp.c:742:9:
> /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error:
> array subscript 1 is outside array bounds of
> ‘union drv_union_data[1]’ [-Werror=array-bounds]
> 935 | *__P = __A;
> | ~~~~~^~~~~
> ../drivers/net/qede/base/ecore_mcp.c: In function
> ‘ecore_mcp_cmd_and_union’:
> ../drivers/net/qede/base/ecore_mcp.c:533:30: note: at offset 32 into
> object ‘union_data’ of size 32
> 533 | union drv_union_data union_data;
> | ^~~~~~~~~~
>
> Since this code is in the base driver, waive the check until the base
> driver is fixed by the relevant people.
Even there are two maintainers, haven't heard a response from them.
It could be a real bug.
On Wed, Jun 22, 2022 at 1:17 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
> > GCC raises the following warning:
> >
> > In function ‘_mm256_storeu_si256’,
> > inlined from ‘rte_mov32’ at
> > ../lib/eal/x86/include/rte_memcpy.h:320:2,
> > inlined from ‘rte_mov128’ at
> > ../lib/eal/x86/include/rte_memcpy.h:342:2,
> > inlined from ‘rte_memcpy_generic’ at
> > ../lib/eal/x86/include/rte_memcpy.h:438:4,
> > inlined from ‘rte_memcpy’ at
> > ../lib/eal/x86/include/rte_memcpy.h:882:10,
> > inlined from ‘__ecore_mcp_cmd_and_union’ at
> > ../drivers/net/qede/base/ecore_mcp.c:541:3,
> > inlined from ‘_ecore_mcp_cmd_and_union’ at
> > ../drivers/net/qede/base/ecore_mcp.c:638:2,
> > inlined from ‘ecore_mcp_cmd_and_union’ at
> > ../drivers/net/qede/base/ecore_mcp.c:742:9:
> > /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error:
> > array subscript 1 is outside array bounds of
> > ‘union drv_union_data[1]’ [-Werror=array-bounds]
> > 935 | *__P = __A;
> > | ~~~~~^~~~~
> > ../drivers/net/qede/base/ecore_mcp.c: In function
> > ‘ecore_mcp_cmd_and_union’:
> > ../drivers/net/qede/base/ecore_mcp.c:533:30: note: at offset 32 into
> > object ‘union_data’ of size 32
> > 533 | union drv_union_data union_data;
> > | ^~~~~~~~~~
> >
> > Since this code is in the base driver, waive the check until the base
> > driver is fixed by the relevant people.
>
> Even there are two maintainers, haven't heard a response from them.
> It could be a real bug.
Maintainers were pinged privately but I see no progress.
If I don't get a reply from them by tomorrow morning (GMT+2), I will
merge your RFC patch as it seems the best fix atm.
https://patchwork.dpdk.org/project/dpdk/patch/20220607171746.461772-3-stephen@networkplumber.org/
@@ -44,6 +44,11 @@ error_cflags = [
'-Wno-sometimes-uninitialized',
'-Wno-pointer-bool-conversion',
]
+# FIXME
+if (toolchain == 'gcc' and cc.version().version_compare('>=12.0.0'))
+ error_cflags += ['-Wno-array-bounds']
+endif
+
c_args = cflags
foreach flag: error_cflags
if cc.has_argument(flag)