mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
a3aebc983b
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.
19 lines
262 B
R
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;
|
|
}
|