quakeforge/tools/qfcc/test/postop.r
Bill Currie a3aebc983b [qfcc] Add dependency edges for moved labels
When moving an identifier label from one node to another, the first node
must be evaluated before the second node, which the edge guarantees.
However, code for swapping two variables

    t = a; a = b; b = t;

creates a dependency cycle. The solution is to create a new leaf node
for the source operand of the assignment. This fixes the swap.r test
without pessimizing postop code.

This takes care of the core problem in #3, but there is still room for
improvement in that the load/store can be combined into a move.
2021-06-29 14:42:16 +09:00

19 lines
262 B
R

int array[3] = { -1, -1, -1 };
int array_index (void)
{
int i = 0;
for (int c = 0; c < 3; c++) {
array[i++] = 0;
}
return i == 3 && !(array[0] | array[1] | array[2]);
}
int
main ()
{
int ret = 0;
ret |= !array_index ();
return ret;
}