Skip to content

Commit ce78375

Browse files
committed
[zep fromtree] platform: stm: workaround compiler error
Make local function DMA_List_CheckNodesBaseAddresses() never inlined. This fixes a build issue faced with with STM32H5 DMA HAL when building TF-M for regression tests with GCC11 and GCC12 compilers with optimization directives. The build issue is not very explicit, as reported by the build error trace message below: during GIMPLE pass: evrp /__w/zephyr/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/stm/common/stm32h5xx/hal/Src/stm32h5xx_hal_dma_ex.c: In function 'HAL_DMAEx_List_ReplaceNode_Head': /__w/zephyr/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/stm/common/stm32h5xx/hal/Src/stm32h5xx_hal_dma_ex.c:4683:1: internal compiler error: Segmentation fault 4683 | } | ^ 0x7f6e24cfb32f ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0x7f6e24ce01c9 __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 0x7f6e24ce028a __libc_start_main_impl ../csu/libc-start.c:360 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://github.com/zephyrproject-rtos/sdk-ng/issues> for instructions. The issue was tracked in GCC [1] and has been addressed in GCC 13 and later. This fix is equivalent to a fix already applied to HAL driver of stm32u5 and stm32wbaxx platforms, see commit 578a6f4 and ec61e69. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106878 [1] Change-Id: I49479c45ad3407b715ef337dccb8cc9707d7c721 Signed-off-by: Tim Pambor <[email protected]> (cherry picked from commit a2f9eb776420357dc5c747d904bc10368de51268)
1 parent c2f9edc commit ce78375

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

platform/ext/target/stm/common/stm32h5xx/hal/Src/stm32h5xx_hal_dma_ex.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,11 @@ static void DMA_List_BuildNode(DMA_NodeConfTypeDef const *const pNodeConfig,
534534
DMA_NodeTypeDef *const pNode);
535535
static void DMA_List_GetNodeConfig(DMA_NodeConfTypeDef *const pNodeConfig,
536536
DMA_NodeTypeDef const *const pNode);
537+
#if (__GNUC__ == 11) || (__GNUC__ == 12)
538+
static __attribute__((noinline)) uint32_t DMA_List_CheckNodesBaseAddresses(DMA_NodeTypeDef const *const pNode1,
539+
#else
537540
static uint32_t DMA_List_CheckNodesBaseAddresses(DMA_NodeTypeDef const *const pNode1,
541+
#endif
538542
DMA_NodeTypeDef const *const pNode2,
539543
DMA_NodeTypeDef const *const pNode3);
540544
static uint32_t DMA_List_CheckNodesTypes(DMA_NodeTypeDef const *const pNode1,
@@ -4071,7 +4075,11 @@ static void DMA_List_GetNodeConfig(DMA_NodeConfTypeDef *const pNodeConfig,
40714075
* @param pNode3 : Pointer to a DMA_NodeTypeDef structure that contains linked-list node 3 registers configurations.
40724076
* @retval Return 0 when nodes addresses are compatible, 1 otherwise.
40734077
*/
4078+
#if (__GNUC__ == 11) || (__GNUC__ == 12)
4079+
static __attribute__((noinline)) uint32_t DMA_List_CheckNodesBaseAddresses(DMA_NodeTypeDef const *const pNode1,
4080+
#else
40744081
static uint32_t DMA_List_CheckNodesBaseAddresses(DMA_NodeTypeDef const *const pNode1,
4082+
#endif
40754083
DMA_NodeTypeDef const *const pNode2,
40764084
DMA_NodeTypeDef const *const pNode3)
40774085
{

0 commit comments

Comments
 (0)