-funsafe-loop-optimizations

Martin Dalecki martin@dalecki.de
Sun Jan 2 03:35:00 GMT 2005


On 2005-01-01, at 17:53, Zdenek Dvorak wrote:
>
> I think Richard means issuing warning in case where
> -funsafe-loop-optimizations causes us to ignore some conditions
> for optimizations we were not able to prove.  Which definitely is
> a good idea.

Micro tweaking on this level isn't supposed to be done on the scope of 
whole
files/compilation units. Perhaps a pragma directive allowing to get 
better assembler output
from a particular carefully selected part of the code after profiling 
could be of some use:

#include <stdio.h>

#pragma begin tighten code
int some_read_init_paramaters(...)
{
     // We don't give a sh*t about the speed, since it's string parsing
     // and we do it only once here. Better generate compact code to 
save flash
     // on this microcontroller here.
}
#pragma end tighten code

/* Uff, I didn't have to go to assembler coding on this DSP, since I 
discovered that the
  * following pragma did result in sufficiently performing code output by
  * a margin of 5%... The video doesn't stutter anymore...
  */
#pragma begin assume infinite arithmetic domains
int fft(unsigned int *real, unsigned int *imaginary, unsigned int 
*signal)
{
	/* butterfly... butterfly... */
}
#pragma end assume infinite arithmeric domains



More information about the Gcc mailing list