OSDN Git Service

Remove special x86 flag that disables tail call optimization.
authorChih-Hung Hsieh <chh@google.com>
Thu, 19 Mar 2015 00:18:20 +0000 (17:18 -0700)
committerChih-hung Hsieh <chh@google.com>
Wed, 25 Mar 2015 00:19:16 +0000 (00:19 +0000)
Clang's tail call optimization for position independent code
only works when the callee was called (bound in GOT) before
the jump through GOT.
It does not work for some lazy bound Android tail callee.
We used special flag to disable all tail call optimization.

This change removes that global flag and depends on
clang compiler fix from upstream or the temporary patch in
https://android-review.googlesource.com/#/c/142241

See proposed llvm changes and pointers to llvm bugs in
https://android-review.googlesource.com/#/c/142792

Change-Id: Idb6e98d6b5f0e4c3676884b69eb3e767eba2491a

core/clang/TARGET_x86.mk

index 3ba34ae..bbbe6f1 100644 (file)
@@ -19,11 +19,8 @@ CLANG_CONFIG_x86_TARGET_EXTRA_CFLAGS := \
   $(CLANG_CONFIG_TARGET_EXTRA_CFLAGS) \
   $(CLANG_CONFIG_x86_EXTRA_CFLAGS) \
   $(CLANG_CONFIG_x86_TARGET_EXTRA_ASFLAGS) \
-  -fno-optimize-sibling-calls \
   -mstackrealign
 
-# http://llvm.org/bugs/show_bug.cgi?id=15086,
-# llvm tail call optimization is wrong for x86.
 # -mstackrealign is needed to realign stack in native code
 # that could be called from JNI, so that movaps instruction
 # will work on assumed stack aligned local variables.