Commit 7bd16ea6 authored by Charles Jacobsen's avatar Charles Jacobsen
Browse files

Turn off interprocedural optimizations only on nested async function.

Rather than do -fno-ipa-sra and -fno-ipa-cp (no interprocedural
analysis that removes unused arguments, constant propagation, etc.),
we can just turn it off on the function (thc_nested_async) that we
really care about. In this way also, libasync users don't need to
worry about setting these compiler flags.
parent 343dad2e
......@@ -15,7 +15,7 @@ AM_CPPFLAGS = \
-I$(abs_top_builddir)/src/include \
-I$(LIBFIPC_DIR)/include
AM_CFLAGS = -fno-ipa-cp -fno-ipa-sra -DLINUX_KERNEL -DCONFIG_LAZY_THC
AM_CFLAGS = -DLINUX_KERNEL -DCONFIG_LAZY_THC
COMMON_SRCS= \
common/thc.c \
......
......@@ -110,9 +110,17 @@ typedef int errval_t;
extern void * CONT_RET_FN_NAME(_C) (void); \
\
/* Define nested function containing the body */ \
noinline auto void _thc_nested_async(FORCE_ARGS_STACK awe_t *awe) __asm__(NESTED_FN_STRING(_C)); \
\
/* XXX: With these attributes, we're no longer portable with other \
* compilers ... */ \
auto void \
noinline \
__attribute__((optimize("no-ipa-sra","no-ipa-cp"))) \
_thc_nested_async(FORCE_ARGS_STACK awe_t *awe) \
__asm__(NESTED_FN_STRING(_C)); \
\
noinline void _thc_nested_async(FORCE_ARGS_STACK awe_t *awe) { \
noinline \
void _thc_nested_async(FORCE_ARGS_STACK awe_t *awe) { \
void *_my_fb = _fb_info; \
_awe.current_fb = _my_fb; \
INIT_LAZY_AWE(awe, &_thc_lazy_awe_marker); \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment