memset from ROM isn't always used anymore since GCC 13.2 update (IDFGH-12173) #13228
Closed
3 tasks done
Labels
Resolution: NA
Issue resolution is unavailable
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Answers checklist.
IDF version.
v5.3-dev-2058-gf68c131e56
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
What is the expected behavior?
I'm expecting the ROM version of memset (and all other defined in esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld) to be always used.
What is the actual behavior?
Since the update to GCC 13.2 (2585e53) sometimes memset is inlined and performance is affected in some case.
See 5.2 disassembly vs 5.3 one:
5.2_memset.txt
5.3_memset.txt
Steps to reproduce.
See example of use of memset that produce the above disassembly.
https://github.com/darthcloud/BlueRetro/blob/b78459b36b6665bfb71b3fb2f3c02324e34c154a/main/bluetooth/host.c#L571-L574
sdkconfig.txt
Build or installation Logs.
No response
More Information.
Adding to my CmakeList.txt this line fixed the issue:
target_compile_options(${COMPONENT_LIB} PRIVATE -fno-builtin-memset)
The text was updated successfully, but these errors were encountered: