]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/comp.c (Fcomp__compile_ctxt_to_file): Confine gcc optim level in [0, 3].
authorAndrea Corallo <akrl@sdf.org>
Thu, 18 Jun 2020 21:14:06 +0000 (23:14 +0200)
committerAndrea Corallo <akrl@sdf.org>
Sun, 21 Jun 2020 22:15:36 +0000 (00:15 +0200)
src/comp.c

index 82a092ad3563e58165e11674fd1b6fd76873958f..7547a40019d3fb209e2327eff8a7ebb99b44d64a 100644 (file)
@@ -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 =