From 89b6f56de011fa45934800a60bf631fc99ef2a4c Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Thu, 18 Jun 2020 23:14:06 +0200 Subject: [PATCH] * src/comp.c (Fcomp__compile_ctxt_to_file): Confine gcc optim level in [0, 3]. --- src/comp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/comp.c b/src/comp.c index 82a092ad356..7547a40019d 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4032,7 +4032,8 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file, gcc_jit_context_set_int_option (comp.ctxt, GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL, - COMP_SPEED); + COMP_SPEED < 0 ? 0 + : (COMP_SPEED > 3 ? 3 : COMP_SPEED)); comp.d_default_idx = CALL1I (comp-data-container-idx, CALL1I (comp-ctxt-d-default, Vcomp_ctxt)); comp.d_impure_idx = -- 2.39.5