On 22.11.2017 16:51, Michael Davidsaver wrote:
On 11/22/2017 06:28 AM, Dirk Zimoch wrote:
The vxWorks 6.6 and 6.7 builds failed here:
../../src/misc/pv/typeCast.h: In function
'void<unnamed>::castVTyped(size_t, void*, const void*) [with TO = long
long unsigned int, FROM = double]':
../../src/misc/pv/typeCast.h:168: sorry, unimplemented: inlining failed
in call to 'TO epics::pvData::castUnsafe(const FROM&) [with TO = long
long unsigned int, FROM = double]': function not considered for inlining
../../src/misc/typeCast.cpp:37: sorry, unimplemented: called from here
Which GCC version is involved here? It seems like the logic controlling
FORCE_INLINE in templateMeta.h needs to be adjusted.
https://github.com/epics-base/pvDataCPP/blob/master/src/misc/pv/templateMeta.h#L13
This is the gcc that comes with vxWorks:
vxWorks 6.6:
gcc version 4.1.2 (Wind River VxWorks G++ 4.1-82)
vxWorks 6.7:
gcc version 4.1.2 (Wind River VxWorks G++ DWARF-EH 4.1-131)
It gets "__attribute__((always_inline)) inline" and understands it. It
just does not like inlining that particular function, but does not say why.
Here is the pre-processed code:
# 167 "../../src/misc/pv/typeCast.h"
template<typename TO, typename FROM>
static __attribute__((always_inline)) inline TO castUnsafe(const FROM&
from)
{
return detail::cast_helper<TO,FROM>::op(from);
}
__attribute__ ((visibility("default"))) extern void castUnsafeV(size_t
count, ScalarType to, void *dest, ScalarType from, const void *src);
It is called from here:
namespace {
static void noconvert(size_t, void*, const void*)
{
throw std::runtime_error("castUnsafeV: Conversion not supported");
}
template<typename TO, typename FROM>
static void castVTyped(size_t count, void *draw, const void *sraw)
{
TO *dest=(TO*)draw;
const FROM *src=(FROM*)sraw;
const FROM *last = src+count;
try {
while (src != last) {
*dest = castUnsafe<TO,FROM>(*src);
++dest; ++src;
}
} catch (std::exception& ex) {
...