Mail Archives: djgpp/1998/09/23/07:16:25
On Mon, 21 Sep 1998, John S. Fine wrote:
> > One thing that sometimes helps in C is to explicitly tell the compiler
> > that the functions called inside the loop have no side effects, by
> > declaring it with __attribute__((const)). This is described in GCC docs,
> > and sometimes has a dramatic effect on code generated for loops that call
> > functions.
>
> All of my routines in the entire project have side effects.
Then you cannot expect GCC to be clever about optimizing loops that
call these functions. Perhaps rewriting some of them to avoid side
effects is something you could consider.
- Raw text -