Bug 603560 Workaround for Solaris Studio compiler, it failed to compile static const int x = { 1 }; r=edwsmith,nnethercote

--HG--
extra : convert_revision : c4f9bb1b1fd4816604d86045806423025f8e6e4e
This commit is contained in:
Ginn Chen 2010-10-18 19:46:04 +08:00
parent 7eda06e559
commit dc409701ce
2 changed files with 6 additions and 10 deletions

View File

@ -61,7 +61,12 @@ namespace nanojit
#if defined(NJ_USE_UINT32_REGISTER)
#define REGNUM(r) (r)
#elif defined(DEBUG)
#elif defined(DEBUG) || defined(__SUNPRO_CC)
// Always use struct declaration for 'Register' with
// Solaris Studio C++ compiler, because it has a bug:
// Scalar type can not be initialized by '{1}'.
// See bug 603560.
struct Register {
uint32_t n; // the register number
};

View File

@ -1137,15 +1137,6 @@ namespace nanojit
btr RegAlloc::free[ecx], eax // free &= ~rmask(i)
mov r, eax
}
#elif defined __SUNPRO_CC
// Workaround for Sun Studio bug on handler embeded asm code.
// See bug 544447 for detail.
// https://bugzilla.mozilla.org/show_bug.cgi?id=544447
asm(
"bsf %1, %%edi\n\t"
"btr %%edi, (%2)\n\t"
"movl %%edi, %0\n\t"
: "=a"(r) : "d"(set), "c"(&regs.free) : "%edi", "memory" );
#else
asm(
"bsf %1, %%eax\n\t"