- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please take a look:
../PrtTests.cpp(2672): warning #1879: unimplemented pragma ignored
#pragma intrinsic ( _ReadWriteBarrier )
^
Why a fundamental feature is not implemented?
Development Environment:
OS: Windows XP 32-bit
IDE: Visual Studio 2005 SP1
Compilers: Intel C++ / Microsoft C++ / Borland C++ / MinGW / Turbo C++
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
// tstcase.cpp
#include
# pragma intrinsic (_InterlockedExchangeAdd64)
volatile __int64 electronic_city;
int main()
{
__int64 somet;
somet = InterlockedExchangeAdd64(&electronic_city, 0);
return 0;
}
c:\ISSUES\>icl -c tstcase.cpp
Intel C++ Intel 64 Compiler XE for applications running on Intel 64, Version 12.1.1.258 Build 20111011
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
tstcase.cpp
-------------------------
It would be nice if you can provide a testcase to reproduce the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[cpp]// For Sub-Test 1 #pragma intrinsic( _ReadWriteBarrier ) int g_iVariable = 0; // Declared as global // For Sub-Test 2 #pragma intrinsic( _InterlockedExchangeAdd ) volatile LONG g_lVolatileVar = 0; ... // Sub-Test 1 - Verification of _ReadWriteBarrier intrinsic function { ///* #define _USE_READWRITEBARRIER int *piData = NULL; g_iVariable = *piData; #if defined ( _USE_READWRITEBARRIER ) _ReadWriteBarrier(); #endif g_iVariable = 7; // Creates an Access Violation #endif //*/ } // Sub-Test 2 - Verification of _InterlockedExchangeAdd intrinsic function { ///* LONG lInitVal = _InterlockedExchangeAdd( &g_lVolatileVar, 55 ); //*/ } ... [/cpp]
Intel C++ compiler version:
Intel C++ Compiler XE 12.1.3.300 [IA-32]
Intel C++ compiler command line options:
/c /Od /D "WIN32" /D "_CONSOLE" /D "_DEBUG" /D "_VC80_UPGRADE=0x0710"
/D "_UNICODE" /D "UNICODE" /GF /EHsc /RTC1 /MTd /GS /fp:precise /W5 /nologo /ZI /TP
/Qopenmp /Qdiag-disable:111,673
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
c:\forum\U105045>type tst.cpp
#include
#include
// For Sub-Test 1
#pragma intrinsic( _ReadWriteBarrier )
int g_iVariable = 0; // Declared as global
// For Sub-Test 2
#pragma intrinsic( _InterlockedExchangeAdd )
volatile LONG g_lVolatileVar = 0;
// Sub-Test 1 - Verification of _ReadWriteBarrier intrinsic function
void foo1()
{
///*
#define _USE_READWRITEBARRIER
int *piData = NULL;
g_iVariable = *piData;
#if defined ( _USE_READWRITEBARRIER )
_ReadWriteBarrier();
#endif
g_iVariable = 7; // Creates an Access Violation
//#endif
//*/
}
void foo2()
// Sub-Test 2 - Verification of _InterlockedExchangeAdd intrinsic function
{
///*
LONG lInitVal = _InterlockedExchangeAdd( &g_lVolatileVar, 55 );
//*/
}
c:\forum\U105045> icl -c /Od /D "WIN32" /D "_CONSOLE" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /GF /EHsc /RTC1 /MTd /GS /fp:precise /W3 /ZI /TP tst.cpp
Intel C++ Compiler XE for applications running on IA-32, Version 12.1.1.258 Build 20111011
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
tst.cpp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
...
c:\forum\U105045> icl -c /Od /D "WIN32" /D "_CONSOLE" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /GF /EHsc /RTC1 /MTd /GS /fp:precise /W3 /ZI /TP tst.cpp
...
Please change /W3 to /W5.
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
newVal
iff the original value was equal to comparand
; leaves the original value otherwise.
* Returns true
iff the exchange was actually performed.
*/
bool compareExchange(ArithmeticType newVal, ArithmeticType comparand) { return ::InterlockedCompareExchange(&myValue, (LONG)newVal, (LONG)comparand) == (LONG)comparand; }
};
template < >
Interlocked- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page