[LLVMbugs] [Bug 7310] New: Wrong ABI on ARM for classes with non trivial copy constructors
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Jun 7 10:00:32 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=7310
Summary: Wrong ABI on ARM for classes with non trivial copy
constructors
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: rafael.espindola at gmail.com
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
The code
-------------------
class SMLoc {
const char *Ptr;
public:
SMLoc(const SMLoc &RHS);
};
SMLoc foo(void *p);
void bar(void *x) {
foo(x);
}
------------------
Produces
declare arm_aapcscc i32 @_Z3fooPv(i8*) optsize
but
http://www.codesourcery.com/public/cxx-abi/abi.html
in 3.1.4 Return Values says
In general, C++ return values are handled just like C return values.
This includes class type results returned in registers. However, if
the return value type has a non-trivial copy constructor or
destructor, the caller allocates space for a temporary, and passes a
pointer to the temporary as an implicit first parameter preceding both
the this parameter and user parameters. The callee constructs the
return value into this temporary.
Is this also true on Darwin or should I special case this for non-Darwin
systems?
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list