Revert change of __time_critical to __no_inline #3169
No reviewers
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk!3169
Loading…
Reference in a new issue
No description provided.
Delete branch "no-inline-time-critical"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This seems (@will-v-pi) to have been an inadvertent change as part of 2.3.0
Whilst you could argue that time_critical should not be inlined, making it no-inline is a change in behavior, and causes a compiler warning/error if the user had "inline"d it before. Worse, if the warning is ignored, then the a link error happens with both the inline and
__noinline(the function is called, but never created)I think reverting the behavior makes most sense (we have
__no_inline_not_in_flash_funcvs__not_in_flash_funcfor a reason after all).... TLDR if you applyinlineto one of the placement functions, it gets inlined not placed.This change was intentional, to ensure time critical code is placed in the correct location (eg xip_sram), and not inlined into another location.
I would be against reverting it unless there are bugs, in which case if it is reverted the tests may need changing to add no_inline to their time critical code.
I think I agree, __time_critical_func requires a physical function call so marking a function inline and __time_critical_func is a bug
per my comment, changing the behavior of
__time_critical_funcis not something we should do, as it affects pre-existing code and code generation (it potentially adds an actual function call between two possible preivously mutually inlined__time_criticalfuncs where there was none before)... we can argue the merits of whether the above is a wise scenario, but people do and have done it.arguably defining
inline __time_critical_funcis pretty meaningless, however we cant prevent that without breaking the other (hence this issue)The best compromise i can think of is to add
__no_inline_time_critical_func()which i have done... @will-v-pi can you please use this func in places you depend on that behavior and push to this commitI think we should also add a macro like
__sdk_time_critical_funcand replaces all uses inside the SDK with that, then add aPICO_TIME_CRITICAL_SDK_NO_INLINEor similar to toggle that between being defined as__time_critical_funcand__no_inline_time_critical_func, so that the user can still force internal SDK time critical functions to be placed in the correct location?e.g. something like this
0852f12853