mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
Clang produces incorrect Thumb2 assembler when using alloca.
Don't define EIGEN_ALLOCA when generating Thumb with clang.
This commit is contained in:
parent
20991c3203
commit
02a9443db9
@ -588,6 +588,15 @@ template<typename T> struct smart_memmove_helper<T,false> {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// With clang -Oz -mthumb, alloca changes the stack pointer in a way that is
|
||||||
|
// not allowed in Thumb2. -DEIGEN_STACK_ALLOCATION_LIMIT=0 doesn't work because
|
||||||
|
// the compiler still emits bad code because stack allocation checks use "<=".
|
||||||
|
// TODO: Eliminate after https://bugs.llvm.org/show_bug.cgi?id=23772
|
||||||
|
// is fixed.
|
||||||
|
#if defined(__clang__) && defined(__ANDROID__) && defined(__thumb__)
|
||||||
|
#undef EIGEN_ALLOCA
|
||||||
|
#endif
|
||||||
|
|
||||||
// This helper class construct the allocated memory, and takes care of destructing and freeing the handled data
|
// This helper class construct the allocated memory, and takes care of destructing and freeing the handled data
|
||||||
// at destruction time. In practice this helper class is mainly useful to avoid memory leak in case of exceptions.
|
// at destruction time. In practice this helper class is mainly useful to avoid memory leak in case of exceptions.
|
||||||
template<typename T> class aligned_stack_memory_handler : noncopyable
|
template<typename T> class aligned_stack_memory_handler : noncopyable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user