Skip to content

Commit 30ffbc8

Browse files
authored
Disable partial inlining for runtime/str.c (#2662)
* Disable partial inlining for runtime/str.c * Propagate the flag from configure * Regenerate configure
1 parent 44e40db commit 30ffbc8

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

ocaml/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,10 @@ $(DEPDIR)/$(RUNTIME_DIR)/%.npic.$(D): OC_CPPFLAGS += $(OC_NATIVE_CPPFLAGS)
10191019
# https://www.intel.co.uk/content/www/uk/en/support/articles/000055650/processors.html
10201020
$(RUNTIME_DIR)/major_gc.%.$(O): OC_CFLAGS += $(INTEL_JCC_BUG_CFLAGS)
10211021

1022+
# Partial inlining on (at least) caml_string_compare seems to produce
1023+
# worse code.
1024+
$(RUNTIME_DIR)/str.%.$(O): OC_CFLAGS += $(NO_PARTIAL_INLINING_CFLAGS)
1025+
10221026
## Compilation of runtime C files
10231027

10241028
# The COMPILE_C_FILE macro below receives as argument the pattern

ocaml/Makefile.config.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ WITH_PROFINFO=@profinfo@
219219
PROFINFO_WIDTH=@profinfo_width@
220220
HEADER_RESERVED_BITS=@reserved_header_bits@
221221
CUSTOM_OPS_STRUCT_SIZE=@custom_ops_struct_size@
222+
NO_PARTIAL_INLINING_CFLAGS=@no_partial_inlining_cflags@
222223
LIBUNWIND_AVAILABLE=@libunwind_available@
223224
LIBUNWIND_INCLUDE_FLAGS=@libunwind_include_flags@
224225
LIBUNWIND_LINK_FLAGS=@libunwind_link_flags@

ocaml/configure

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ocaml/configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ AC_SUBST([reserved_header_bits])
219219
AC_SUBST([profinfo])
220220
AC_SUBST([profinfo_width])
221221
AC_SUBST([custom_ops_struct_size])
222+
AC_SUBST([no_partial_inlining_cflags])
222223
AC_SUBST([frame_pointers])
223224
AC_SUBST([cpp_mangling])
224225
AC_SUBST([flambda])
@@ -2222,6 +2223,12 @@ AC_DEFINE_UNQUOTED([HEADER_RESERVED_BITS], [$reserved_header_bits])
22222223
AC_DEFINE_UNQUOTED([PROFINFO_WIDTH], [$profinfo_width])
22232224
AS_IF([$profinfo], [AC_DEFINE([WITH_PROFINFO])])
22242225

2226+
# Only gcc supports -fno-partial-inlining
2227+
AS_CASE([$ocaml_cv_cc_vendor],
2228+
[gcc-*],
2229+
[no_partial_inlining_cflags="-fno-partial-inlining"],
2230+
[no_partial_inlining_cflags=""])
2231+
22252232
AC_DEFINE_UNQUOTED([CUSTOM_OPS_STRUCT_SIZE], [$custom_ops_struct_size])
22262233

22272234
AS_IF([test x"$enable_installing_bytecode_programs" = "xno"],

0 commit comments

Comments
 (0)