summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-06-20 18:25:10 +0000
committerdim <dim@FreeBSD.org>2013-06-20 18:25:10 +0000
commitda3b12a1bbf9d2863451efdee810a0ee646494a9 (patch)
tree59b3d8016c1d3f62e4050627ecb0a51a51ae22be /contrib/gcc
parenta73b44b2ba93efe6e1e9eb0f6c57006739aa3f37 (diff)
downloadFreeBSD-src-da3b12a1bbf9d2863451efdee810a0ee646494a9.zip
FreeBSD-src-da3b12a1bbf9d2863451efdee810a0ee646494a9.tar.gz
Pull in r183984 from llvm trunk:
Make PrologEpilogInserter save/restore all callee saved registers in functions which call __builtin_unwind_init() __builtin_unwind_init() is an undocumented gcc intrinsic which has this effect, and is used in libgcc_eh. Goes part of the way toward fixing PR8541. This obsoletes the ugly hack to libgcc's unwind code from r245272, and should also work for other arches, so revert the hack too.
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/unwind-dw2.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/contrib/gcc/unwind-dw2.c b/contrib/gcc/unwind-dw2.c
index 3306e06..62c9d09 100644
--- a/contrib/gcc/unwind-dw2.c
+++ b/contrib/gcc/unwind-dw2.c
@@ -1438,17 +1438,6 @@ uw_init_context_1 (struct _Unwind_Context *context,
context->ra = __builtin_extract_return_addr (outer_ra);
}
-#if defined(__clang__) && defined(__amd64__)
-/* Some versions of clang don't save and restore all callee registers, if a
- __builtin_eh_return() intrinsic is used in a function. This is particularly
- bad on amd64. For now, use the following ugly hack to force it to assume
- those registers are clobbered, when invoking __builtin_eh_return(), so it
- will emit code to save and restore them. */
-#define CLOBBER_REGS_HACK \
- __asm __volatile(" " : : : "r15", "r14", "r13", "r12", "rbx", "rdx", "rax");
-#else
-#define CLOBBER_REGS_HACK
-#endif /* __clang__ */
/* Install TARGET into CURRENT so that we can return to it. This is a
macro because __builtin_eh_return must be invoked in the context of
@@ -1459,7 +1448,6 @@ uw_init_context_1 (struct _Unwind_Context *context,
{ \
long offset = uw_install_context_1 ((CURRENT), (TARGET)); \
void *handler = __builtin_frob_return_addr ((TARGET)->ra); \
- CLOBBER_REGS_HACK \
__builtin_eh_return (offset, handler); \
} \
while (0)
OpenPOWER on IntegriCloud