 |
|
|
|
Actions
|
|
[ Date Prev][ Date Next][ Thread Prev][ Thread Next][ Date Index][ Thread Index]
Re: [coldfire-gnu-discuss] Optimizing problem
- To: "DMS Tech, John" <john@xxxxxxxxxxxx>
- Subject: Re: [coldfire-gnu-discuss] Optimizing problem
- From: Nathan Sidwell <nathan@xxxxxxxxxxxxxxxx>
- Date: Sat, 06 Jan 2007 14:35:28 +0000
DMS Tech, John wrote:
When I use the optimize option –O1 I have a problem that a small delay
loop, used in a boot-loader program, gets optimized out of the code.
Only the function call stays but the actual while loop is removed. Is
there any compiler option to make sure this loop stays intact or a
‘__attribute__’, which will make sure this function is not optimized?
for (i = 0; i != limit; i++)
__asm__ volatile ("");
The compiler will not optimize this loop away, and the body of the loop will be
an empty asm.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan@xxxxxxxxxxxxxxxx :: http://www.planetfall.pwp.blueyonder.co.uk
|
|