return NULL;
}
- if(1) { //!PIC16_IS_CONFIG_ADDRESS(address)) {
+ if(1) { //!PIC16_IS_CONFIG_ADDRESS(address))
// fprintf(stderr,"%s:allocating new reg %s\n",__FUNCTION__, name);
/* this is an error, why added? -- VR */
if(!IN_DIRSPACE( SPEC_OCLS( OP_SYM_ETYPE(op)))) { // patch 13
if(pic16_debug_verbose) //
{ //
- fprintf(stderr, "dispace:%d farspace:%d codespace:%d regspace:%d stack:%d\n",
+ fprintf(stderr, "dispace:%d farspace:%d codespace:%d regspace:%d stack:%d eeprom: %d\n",
IN_DIRSPACE( SPEC_OCLS( OP_SYM_ETYPE(op))),
IN_FARSPACE( SPEC_OCLS( OP_SYM_ETYPE(op))),
IN_CODESPACE( SPEC_OCLS( OP_SYM_ETYPE(op))),
IN_REGSP( SPEC_OCLS( OP_SYM_ETYPE(op))),
- IN_STACK( OP_SYM_ETYPE(op)));
+ IN_STACK( OP_SYM_ETYPE(op)),
+ SPEC_OCLS(OP_SYM_ETYPE(op)) == eeprom);
fprintf(stderr, "%s:%d symbol %s NOT in dirspace\n", __FILE__, __LINE__, //
OP_SYMBOL(op)->name); //
} //
-// return NULL; //
} // patch 13
reg = newReg(regtype, PO_DIR, rDirectIdx++, name,getSize (OP_SYMBOL (op)->type),0, op);
debugLog ("%d -- added %s to hash, size = %d\n", __LINE__, name,reg->size);
-// hTabAddItem(&dynDirectRegNames, regname2key(name), reg); /* commented out */
// if (SPEC_ABSA ( OP_SYM_ETYPE(op)) ) {
// fprintf(stderr, " ralloc.c at fixed address: %s - changing to REG_SFR\n",name);
} else {
debugLog (" -- %s is declared at address 0x30000x\n",name);
-// fprintf(stderr, " -- %s is declared at address 0x30000x\n",name);
return NULL;
}
/* Register wasn't found in hash, so let's create
* a new one and put it in the hash table AND in the
* dynDirectRegNames set */
- fprintf (stderr,"%s:%d symbol name %s\tregop= %p\n", __FUNCTION__, __LINE__, name, op);
+
+// fprintf (stderr,"%s:%d symbol name %s\tregop= %p\n", __FUNCTION__, __LINE__, name, op);
+
reg = newReg(REG_GPR, PO_DIR, rDirectIdx++, name,size,0, op);
debugLog ("%d -- added %s to hash, size = %d\n", __LINE__, name,reg->size);
pic16_groupRegistersInSection(pic16_dynProcessorRegs);
-#if 0
- pic16_assignFixedRegisters(pic16_dynAllocRegs);
- pic16_assignFixedRegisters(pic16_dynStackRegs);
- pic16_assignFixedRegisters(pic16_dynDirectRegs);
- pic16_assignFixedRegisters(pic16_dynProcessorRegs);
-
- pic16_assignRelocatableRegisters(pic16_dynDirectBitRegs, 0);
- pic16_assignRelocatableRegisters(pic16_dynInternalRegs,0);
- pic16_assignRelocatableRegisters(pic16_dynAllocRegs,0);
- pic16_assignRelocatableRegisters(pic16_dynStackRegs,0);
- pic16_assignRelocatableRegisters(pic16_dynDirectRegs,0);
-#endif
-
-// pic16_dump_map();
-// pic16_dump_cblock(of);
-
/* dump equates */
pic16_dump_equates(of, pic16_equ_data);
+// pic16_dump_esection(of, pic16_rel_eedata, 0);
+// pic16_dump_esection(of, pic16_fix_eedata, 0);
+
/* dump initialised data */
pic16_dump_isection(of, rel_idataSymSet, 0);
pic16_dump_isection(of, fix_idataSymSet, 1);
-// pic16_dump_idata(of, idataSymSet);
-
/* dump internal registers */
pic16_dump_int_registers(of, pic16_int_regs);
}
+ /* If the live range preceeds the point of definition
+ then ideally we must take into account registers that
+ have been allocated after sym->liveFrom but freed
+ before ic->seq. This is complicated, so spill this
+ symbol instead and let fillGaps handle the allocation. */
+ if (sym->liveFrom < ic->seq)
+ {
+ spillThis (sym);
+ continue;
+ }
+
/* if it has a spillocation & is used less than
all other live ranges then spill this */
if (willCS) {