In the following code x is 0 and doesn't change, probably because the optimizer recognize that the for loop does nothing, expect increasing the variable x:
#include "common.h"
double
foo (void)
{
return 0.0;
}
void
do_sibcall (void)
{
(void) foo ();
}
int
main (void)
{
double x;
for (x = 0; x < 20; x++)
do_sibcall ();
if (!(x >= 10))
abort ();
exit (0);
}
In the following code x is 0 and doesn't change, probably because the optimizer recognize that the for loop does nothing, expect increasing the variable x:
with
common.h
: