Details
[Home]
Issue of the Implementation # S0740
Brief
::operator new() returns misaligned pointer on PPC32 and S390
Detailed Description
The description of one operator from 'new' family (for other operators from this family requirements on alignment are the same)(18.4.1.1):
void* operator new(std::size_t size) throw(std::bad_alloc);Effects: The allocation function (3.7.3.1) called by a new-expression c(5.3.4) to allocate size bytes of storage suitably aligned to represent any object of that size.
Though, on PPC32 and s390 architectures this operator may return address which is not aligned on 16 bytes, even when size >= 16. But "SYSTEM V APPLICATION BINARY INTERFACE PowerPC Processor Supplement" and "S/390 ELF Application Binary Interface Supplement" state that size of 'long double' is 16 bytes and alignment of 'long double' is 16 bytes.
The implementation of new operator uses malloc function, and there are known issues with alignment in it on PPC32 and s390 architectures.
Problem location(s) in the standard
Linux Standard Base C++ Specification 3.2, Chapter 9. Libraries, 9.1. Interfaces for libstdcxx that refers ISO/IEC 14882: 2003 Programming languages --C++, section 18.4.4.1
Component
libstdc++
Environment
Architectures
PPC32, s390
References
http://sources.redhat.com/bugzilla/show_bug.cgi?id=6527
[Home]