D-Programming-Language/dmd — pull request #2503 by monarchdodra (2013-08-29 07:24:33+00:00)
Title: Fix Issue 10897 - btc, btr and bts shouldn't be safe

This requires druntime pull https://github.com/D-Programming-Language/druntime/pull/596 to be merged *at the same time*.

Both compile individually, which means the safety change isn't breaking anything, but they won't link unless done together. I tested on a linux 64 machine, with both 32 and 64 builds. Unittests pass for dmd/druntime/phobos.

I changed the mangled names inside the DMDV2 blocks. I left the DMDV1 names alone, eg:

```C
int intrinsic_op(char *name)
{
#if TX86
//printf("intrinsic_op(%s)\n", name);
static const char *std_namearray[] =
{
#if DMDV1
"9intrinsic3btcFPkkZi", //UN-changed
"9intrinsic3btrFPkkZi", //UN-changed
"9intrinsic3btsFPkkZi", //UN-changed
#elif DMDV2
/* The names are mangled differently because of the pure and
* nothrow attributes.
*/
//...
#endif
};
static const char *std_namearray64[] =
{
#if DMDV1
"9intrinsic3btcFPmmZi", //UN-changed
"9intrinsic3btrFPmmZi", //UN-changed
"9intrinsic3btsFPmmZi", //UN-changed
#elif DMDV2
/* The names are mangled differently because of the pure and
* nothrow attributes.
*/
//...
#endif
};
static unsigned char std_ioptab[] =
{
//...
};

#ifdef DMDV2
static const char *core_namearray[] =
{
"5bitop3btcFNaNbPmmZi", //Changed
"5bitop3btrFNaNbPmmZi", //Changed
"5bitop3btsFNaNbPmmZi", //Changed
};
static const char *core_namearray64[] =
{
"5bitop3btcFNaNbPmmZi", //Changed
"5bitop3btrFNaNbPmmZi", //Changed
"5bitop3btsFNaNbPmmZi", //Changed
};
static unsigned char core_ioptab[] =
{
//...
};
#endif
```