#if defined(DEBUG) || defined(LATE_DISASM)
// Add code size information into the Perf Score
- compiler->info.compPerfScore += (compiler->info.compTotalHotCodeSize * PERFSCORE_CODESIZE_COST_HOT);
- compiler->info.compPerfScore += (compiler->info.compTotalColdCodeSize * PERFSCORE_CODESIZE_COST_COLD);
+ // All compPerfScore calculations must be performed using doubles
+ compiler->info.compPerfScore += ((double)compiler->info.compTotalHotCodeSize * (double)PERFSCORE_CODESIZE_COST_HOT);
+ compiler->info.compPerfScore +=
+ ((double)compiler->info.compTotalColdCodeSize * (double)PERFSCORE_CODESIZE_COST_COLD);
#endif // DEBUG || LATE_DISASM
#ifdef DEBUG
#if defined(DEBUG) || defined(LATE_DISASM)
float insExeCost = insEvaluateExecutionCost(id);
- emitComp->info.compPerfScore += (ig->igWeight / BB_UNITY_WEIGHT) * insExeCost;
+ // All compPerfScore calculations must be performed using doubles
+ emitComp->info.compPerfScore += (double)(ig->igWeight / (double)BB_UNITY_WEIGHT) * insExeCost;
#endif // defined(DEBUG) || defined(LATE_DISASM)
// printf("[S=%02u]\n", emitCurStackLvl);