+ /* for every iCode do */
+ for (ic = ebbs[i]->sch; ic; ic = ic->next)
+ {
+ symbol *sym1, *sym2;
+ int key1, key2;
+
+ /* for all iTemps alive at this iCode */
+ for (key1 = 1; key1 < ic->rlive->size; key1++)
+ {
+ if (!bitVectBitValue(ic->rlive, key1))
+ continue;
+
+ sym1 = hTabItemWithKey(liveRanges, key1);
+
+ if (!sym1->isitmp)
+ continue;
+
+ /* for all other iTemps alive at this iCode */
+ for (key2 = key1+1; key2 < ic->rlive->size; key2++)
+ {
+ if (!bitVectBitValue(ic->rlive, key2))
+ continue;
+
+ sym2 = hTabItemWithKey(liveRanges, key2);
+
+ if (!sym2->isitmp)
+ continue;
+
+ /* if the result and left or right is an iTemp */
+ /* than possibly the iTemps do not clash */
+ if ((ic->op != JUMPTABLE) && (ic->op != IFX) &&
+ IS_ITEMP(IC_RESULT(ic)) &&
+ (IS_ITEMP(IC_LEFT(ic)) || IS_ITEMP(IC_RIGHT(ic))))
+ {
+ if (OP_SYMBOL(IC_RESULT(ic))->key == key1
+ && sym1->liveFrom == ic->seq
+ && sym2->liveTo == ic->seq)
+ {
+ if (IS_SYMOP(IC_LEFT(ic)))
+ if (OP_SYMBOL(IC_LEFT(ic))->key == key2)
+ continue;
+ if (IS_SYMOP(IC_RIGHT(ic)))
+ if (OP_SYMBOL(IC_RIGHT(ic))->key == key2)
+ continue;
+ }
+
+ if (OP_SYMBOL(IC_RESULT(ic))->key == key2
+ && sym2->liveFrom == ic->seq
+ && sym1->liveTo == ic->seq)
+ {
+ if (IS_SYMOP(IC_LEFT(ic)))
+ if (OP_SYMBOL(IC_LEFT(ic))->key == key1)
+ continue;
+ if (IS_SYMOP(IC_RIGHT(ic)))
+ if (OP_SYMBOL(IC_RIGHT(ic))->key == key1)
+ continue;
+ }
+ }
+
+ /* the iTemps do clash. set the bits in clashes */
+ sym1->clashes = bitVectSetBit (sym1->clashes, key2);
+ sym2->clashes = bitVectSetBit (sym2->clashes, key1);
+
+ /* check if they share the same spill location */
+ /* what is this good for? */
+ if (SYM_SPIL_LOC(sym1) && SYM_SPIL_LOC(sym2) &&
+ SYM_SPIL_LOC(sym1) == SYM_SPIL_LOC(sym2))
+ {
+ if (sym1->reqv && !sym2->reqv) SYM_SPIL_LOC(sym2)=NULL;
+ else if (sym2->reqv && !sym1->reqv) SYM_SPIL_LOC(sym1)=NULL;
+ else if (sym1->used > sym2->used) SYM_SPIL_LOC(sym2)=NULL;
+ else SYM_SPIL_LOC(sym1)=NULL;
+ }
+ }
+ }