I want to see the effect of -fgcse flag in STM32 gcc.? Is there any way I can check? I tried generating assembly code for a simple code with and without -fgcse flag with O0 optimization and both files look the same! Is the flag supported?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-08-22 7:18 AM
I am using GNU tools for STM32 (10.3-2021.10).
STM32CubeIDE
Version: 1.9.0
Build: 12015_20220302_0855 (UTC)
- Labels:
-
STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-08-22 11:21 PM
For those (like me) who didn’t know,
-fgcse Performs a global common subexpression elimination pass. This pass also performs global constant and copy propagation.
So your simple code must have global common subexpressions (whatever they are) for the optimizer to eliminate any duplication.
That said, gcc says the last option in the command-line overrides any previous options. Have you checked the command-line that invoked gcc to see if ogcse came before or after o0?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-08-30 6:53 AM
Hello @gits007
Could you please confirm if the issue is resolved or you are in need of further support.
Kind regards,
Semer.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
