1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

* Have comp do not use builtin_expect with libgccjit < 14 (bug#79722)

* src/comp.c (emit_EQ): Do not use '__builtin_expect' with
libgccjit < 14.
This commit is contained in:
Andrea Corallo 2025-12-04 16:48:34 +01:00
parent d63ed68684
commit d52bf63de2

View file

@ -1523,25 +1523,30 @@ emit_EQ (gcc_jit_rvalue *x, gcc_jit_rvalue *y)
gcc_jit_rvalue_dereference (comp.f_symbols_with_pos_enabled_ref, gcc_jit_rvalue_dereference (comp.f_symbols_with_pos_enabled_ref,
NULL)); NULL));
gcc_jit_rvalue *expect_args[] = /* Do not use '__builtin_expect' with libgccjit < 14 (bug#79722). */
{ emit_coerce (comp.long_type, symbols_with_pos_enabled_rval), Lisp_Object version = Fcomp_libgccjit_version ();
gcc_jit_context_new_rvalue_from_int (comp.ctxt, if (!NILP (version) && XFIXNUM (XCAR (version)) >= 14)
comp.long_type, {
0) }; gcc_jit_rvalue *expect_args[] =
{ emit_coerce (comp.long_type, symbols_with_pos_enabled_rval),
gcc_jit_context_new_rvalue_from_int (comp.ctxt,
comp.long_type,
0) };
gcc_jit_rvalue *unlikely_symbols_with_pos_enabled = emit_coerce ( gcc_jit_rvalue *symbols_with_pos_enabled_rval = emit_coerce (
comp.bool_type, comp.bool_type,
gcc_jit_context_new_call ( gcc_jit_context_new_call (
comp.ctxt, comp.ctxt,
NULL, NULL,
gcc_jit_context_get_builtin_function (comp.ctxt, gcc_jit_context_get_builtin_function (comp.ctxt,
"__builtin_expect"), "__builtin_expect"),
2, 2,
expect_args)); expect_args));
}
return emit_OR ( return emit_OR (
base_eq, base_eq,
emit_AND (unlikely_symbols_with_pos_enabled, emit_slow_eq (x, y))); emit_AND (symbols_with_pos_enabled_rval, emit_slow_eq (x, y)));
} }
static gcc_jit_rvalue * static gcc_jit_rvalue *