- if(getenv("OPTIMIZE_NEAR_POINTER_GET"))
-
- if (IS_ARITHMETIC_OP(ic)
- && !IS_OP_LITERAL (IC_LEFT (ic))
- && !OP_SYMBOL (IC_RESULT(ic))->rematiCode
- && !OP_SYMBOL (IC_LEFT(ic))->rematiCode
- && (OP_LIVETO (IC_LEFT(ic) ) <= ic->seq)
- ) {
- iCode *dic = ic->prev;
-
- /* search backwards to find assignment from a remat pointer */
- while(dic && dic->seq >= OP_LIVEFROM( IC_LEFT(ic) )) {
-
- /* is it a pointer_get? */
- if(POINTER_GET(dic)
- && IS_DATA_PTR(OP_SYM_TYPE (IC_LEFT (dic)))) {
- fprintf(stderr, "%s:%d `%s' is a data pointer (ic seq: %d)\n", __FILE__, __LINE__,
- OP_SYMBOL(IC_LEFT(dic))->rname, dic->seq);
-
- /* so we can replace ic->left with dic->left, & remove assignment */
- ReplaceOpWithCheaperOp( &IC_LEFT(ic), IC_LEFT(dic) );
-
- bitVectUnSetBit(OP_USES( IC_LEFT(ic) ), ic->key);
- bitVectUnSetBit(OP_DEFS( IC_RESULT(dic) ), dic->key );
-
-// dic->op = DUMMY_READ_VOLATILE;
-#if 1
- remiCodeFromeBBlock(ebp, dic);
- hTabDeleteItem(&iCodehTab, dic->key, dic, DELETE_ITEM, NULL);
-#endif
- break;
- }
- dic = dic->prev;
- }
+ if(getenv("OPTIMIZE_NEAR_POINTER_GET")) {
+ static int fsr0usage=0;
+ static iCode *usic;
+
+ if(POINTER_GET(ic) /* this is a memory read */
+ && ic->loop /* this is in a loop */
+ ) {
+ fprintf(stderr, "might optimize FSR0 usage\n");
+ }