On Feb 25, 2005, at 9:47 AM, Joern RENNECKE wrote:
consider: for (;;i++ ) { if (i == 1000) i = 0; /* do stuff... */ }
The "i = 0;" statement is in its own cold block.
On a number of targets, a conditional jump can't reach the cold
section, so you'd have to replace a condjump around a simple instruction
by a condjump around an jump,
Well, no, what is supposed to happen (I haven't tried it for a while, so I don't promise
this still works) is code like this:
.hotsection: loop: conditional branch (i?==1000) to L2 L1: /* do stuff */ end loop:
/* still in hot section */ L2: jmp L3
.coldsection: L3: i = 0; jmp L1