GCC experts question

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

Posts: 7
Joined: Wed Jul 18, 2018 7:08 am

GCC experts question

Postby Martin_from_K » Mon Dec 03, 2018 8:14 am


I have a question concerning GCC compiler in TrueStudio.
I want to measure execution times of short routines and for this I set a port bit at the beginning of the range to check and clear it at the end and then use an oscilloscope to measure the time. This works fine and I could improve the speed very much, especially activating optimize speed - I thought.
Now I took a closer look the .list file and found that with optimize speed active the order of assembler instructions is not following the order of C lines and especially the clearing of the portbit is moved a lot of lines forward and is now far before the end of the range I want to measure.
I tried to place isb and / or dsb but no change.
Now my question is : Is there a way to have optimization speed active and force an order of assembler instruction at least in blocks ? I hope I explained clear enough.
(just to put this right: optimize speed is still a big improvement although I got fooled by some lines and I need a precise and comparable measurement here)

Thanks for any help


Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 2 guests