Skip to content

Commit a973447

Browse files
committed
tests/arm_mpu_pxn: Insist that trivial functions are not inlined
GCC 14 takes a look these functions which are just 'return true' and inlines them even though they has the noinline attribute set. This happens because the compiler computes the possible range of values from the function call, and as that is a single value (true), it replaces the call with that value. So it's not strictly inlining the function? Insist a bit harder by adding a compiler_barrier to the functions which seems to solve the issue. Signed-off-by: Keith Packard <[email protected]>
1 parent d854986 commit a973447

File tree

1 file changed

+2
-0
lines changed
  • tests/arch/arm/arm_mpu_pxn/src

1 file changed

+2
-0
lines changed

tests/arch/arm/arm_mpu_pxn/src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
__customramfunc bool custom_ram_func(void)
2020
{
21+
compiler_barrier();
2122
return true;
2223
}
2324

@@ -28,6 +29,7 @@ __customramfunc bool custom_ram_func(void)
2829
*/
2930
__ramfunc bool ram_function(void)
3031
{
32+
compiler_barrier();
3133
return true;
3234
}
3335

0 commit comments

Comments
 (0)