Hi
it seems that pgc++ (15.7) does not support
__attribute__ ((__aligned__(x)))
with x>= 0x100, smaller values seem to be OK.
In boost/config/suffix.hpp the following alignment specifcation appears:
// Type and data alignment specification
//
#if !defined(BOOST_NO_CXX11_ALIGNAS)
# define BOOST_ALIGNMENT(x) alignas(x)
#elif defined(_MSC_VER)
# define BOOST_ALIGNMENT(x) __declspec(align(x))
#elif defined(__GNUC__)
# define BOOST_ALIGNMENT(x) __attribute__ ((__aligned__(x)))
#else
# define BOOST_NO_ALIGNMENT
# define BOOST_ALIGNMENT(x)
#endif
pgc++ seems to define GNUC so BOOST_ALLIGNMENT(x) is defined as attribute ((aligned(x))).
In boost/move/detail/type_traits.hpp the BOOST_ALIGNMENT macro is used:
/////////////////////////////
// aligned_storage
/////////////////////////////
#if !defined(BOOST_NO_ALIGNMENT)
template<std::size_t Len, std::size_t Align>
struct aligned_storage_impl;
#define BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(A)\
template<std::size_t Len>\
struct BOOST_ALIGNMENT(A) aligned_storage_impl<Len, A>\
{\
char dummy[Len];\
typedef aligned_storage_impl<Len, A> type;\
};\
//
//Up to 4K alignment (typical page size)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x1)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x2)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x4)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x8)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x10)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x20)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x40)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x80)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x100)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x200)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x400)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x800)
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x1000)
#undef BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT
#else //BOOST_NO_ALIGNMENT
When including e.g. boost/move/move.hpp pgc++ produces the following errors:
../boost/move/detail/type_traits.hpp", line 921: error:
invalid alignment value specified by attribute
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x100)
^
"../boost/move/detail/type_traits.hpp", line 922: error:
invalid alignment value specified by attribute
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x200)
^
"../boost/move/detail/type_traits.hpp", line 923: error:
invalid alignment value specified by attribute
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x400)
^
"../boost/move/detail/type_traits.hpp", line 924: error:
invalid alignment value specified by attribute
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x800)
^
"../boost/move/detail/type_traits.hpp", line 925: error:
invalid alignment value specified by attribute
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x1000)
^
5 errors detected in the compilation of "main.C".
The only workaround I found was to add
#elif defined(__PGI)
# define BOOST_NO_ALIGNMENT
# define BOOST_ALIGNMENT(x)
above
#elif defined(__GNUC__)
# define BOOST_ALIGNMENT(x) __attribute__ ((__aligned__(x)))
to basically switch off alignment. However, this probably has an impact on performance.
Thanks,
LS