+2006-05-20 Raphael Neider <rneider AT web.de>
+
+ * src/pic/gen.c (bitpatternFromVal): fixed for 64-bit machines
+ * src/pic16/ralloc.c (newReg): use correct name in hashtable,
+ (allocReg): add only new registers to dynAllocRegs,
+ (pic16_assignRegisters): do not reset dynrIdx, fixes bugs
+ #1489055, #1445850, and probably #1483693
+
2006-05-19 Vangelis Rokas <vrokas AT users.sourceforge.net>
* src/pic16/glue.c (pic16_emitConfigRegs, pic16_emitIDRegs): fixed
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <stdint.h>
#include "SDCCglobl.h"
#include "newalloc.h"
{
union {
float d;
- unsigned long l;
+ uint32_t l;
} float_long;
- assert (sizeof (float) == sizeof (long));
+ assert (sizeof (float) == sizeof (uint32_t));
//fprintf (stderr, "%s:%u(%s): val=%lf, type: %d, etype: %d\n", __FILE__, __LINE__, __FUNCTION__, floatFromVal(val), SPEC_NOUN(val->type), SPEC_NOUN(val->etype));
vsprintf (buffer, fmt, ap);
fprintf (debugF, "%s", buffer);
+ //fprintf (stderr, "%s", buffer);
/*
while (isspace((unsigned char)*bufferP)) bufferP++;
dReg->regop = refop;
if(!(type == REG_SFR && alias == 0x80))
- hTabAddItem(&dynDirectRegNames, regname2key(name), dReg);
+ hTabAddItem(&dynDirectRegNames, regname2key(dReg->name), dReg);
return dReg;
}
// (_inRegAllocator)?"ralloc":"", currFunc, reg->name, reg->rIdx);
#if 1
- if(_inRegAllocator && (dynrIdx > MAX_P16_NREGS)) {
-// debugf("allocating more registers than available\n", 0);
-// return (NULL);
- }
+ if(_inRegAllocator && (dynrIdx > MAX_P16_NREGS)) {
+ // debugf("allocating more registers than available\n", 0);
+ // return (NULL);
+ }
+
+ addSet(&pic16_dynAllocRegs, reg);
+ hTabAddItem(&dynAllocRegNames, regname2key(reg->name), reg);
+// fprintf(stderr, "%s:%d added reg to pic16_dynAllocRegs = %p\n", __FUNCTION__, __LINE__, pic16_dynAllocRegs);
#endif
}
-
- addSet(&pic16_dynAllocRegs, reg);
- hTabAddItem(&dynAllocRegNames, regname2key(reg->name), reg);
-
-// fprintf(stderr, "%s:%d added reg to pic16_dynAllocRegs = %p\n", __FUNCTION__, __LINE__, pic16_dynAllocRegs);
debugLog ("%s of type %s for register rIdx: %d (0x%x)\n", __FUNCTION__, debugLogRegType (type), dynrIdx-1, dynrIdx-1);
regTypeNum ();
/* start counting function temporary registers from zero */
- dynrIdx = 0;
+ /* XXX: Resetting dynrIdx breaks register allocation,
+ * see #1489055, #1483693 (?), and #1445850! */
+ //dynrIdx = 0;
/* and serially allocate registers */
serialRegAssign (ebbs, count);