Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memset from ROM isn't always used anymore since GCC 13.2 update (IDFGH-12173) #13228

Closed
3 tasks done
darthcloud opened this issue Feb 21, 2024 · 1 comment
Closed
3 tasks done
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@darthcloud
Copy link

darthcloud commented Feb 21, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

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)

@darthcloud darthcloud added the Type: Bug bugs in IDF label Feb 21, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 21, 2024
@github-actions github-actions bot changed the title memset from ROM isn't always used anymore since GCC 13.2 update memset from ROM isn't always used anymore since GCC 13.2 update (IDFGH-12173) Feb 21, 2024
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels Feb 28, 2024
@darthcloud
Copy link
Author

darthcloud commented Mar 1, 2024

Tested in latest master and it's fixed! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

2 participants