Fix: powerpc32: transparent unions alter calling convention
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Sep 2021 20:57:02 +0000 (16:57 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Sep 2021 21:10:08 +0000 (17:10 -0400)
commit087bce43020d2b45dab2dd8ecd6b0d6949c626f3
treeae930e90c1ad88e669b709878bfb20a3dbeffa64
parente915ab84fd0c02d37504f3eb1e1f3be93ea6dc37
Fix: powerpc32: transparent unions alter calling convention

On powerpc32, transparent unions have an impact on the calling
convention used for the argument, as they use the calling convention of
the first field of the union rather than the union itself. On powerpc32,
the calling convention for a union is that the register has a pointer to
the union, which differs from the calling convention of its first field
(which is a pointer in this case).

"[...] the argument is passed to the function using the calling
conventions of the first member of the transparent union, not the
calling conventions of the union itself. All members of the union must
have the same machine representation; this is necessary for this
argument passing to work properly." [1]

Therefore, use a transparent union for c++ so c++ compilers can emit
caller code with a compatible stack layout. The "ignored attribute"
warning emitted by clang appears to be only for architectures where the
calling convention is not affected by the presence of transparent union
attribute. Therefore, simply silence this warning.

Link: https://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Type-Attributes.html
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I07182dd4ed37a3f61a226fb199bc98c95f83bd37
include/urcu/compiler.h
include/urcu/lfstack.h
include/urcu/wfcqueue.h
include/urcu/wfstack.h
This page took 0.025242 seconds and 4 git commands to generate.