summaryrefslogtreecommitdiff
path: root/src/comp.c
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-04-05 19:40:51 +0100
committerAndrea Corallo <akrl@sdf.org>2020-04-05 21:11:07 +0100
commit346d50989a446285d38d411f8f77350ba4af5222 (patch)
treeb39239b6c883aa9647d02135320c7ef3121fb52e /src/comp.c
parent598380416cf5bb6bd0cae45ddb3bb03c74da21bb (diff)
downloademacs-346d50989a446285d38d411f8f77350ba4af5222.tar.gz
emacs-346d50989a446285d38d411f8f77350ba4af5222.tar.bz2
emacs-346d50989a446285d38d411f8f77350ba4af5222.zip
* src/comp.c (emit_const_lisp_obj, emit_mvar_val): Fix.
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/comp.c b/src/comp.c
index 904869d99c9..44de1f5fbcb 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -1098,10 +1098,19 @@ emit_const_lisp_obj (Lisp_Object obj)
SSDATA (Fprin1_to_string (obj, Qnil))));
if (NIL_IS_ZERO && EQ (obj, Qnil))
- return emit_coerce (comp.lisp_obj_type,
- gcc_jit_context_new_rvalue_from_ptr (comp.ctxt,
- comp.void_ptr_type,
- NULL));
+ {
+ gcc_jit_rvalue *n;
+#ifdef WIDE_EMACS_INT
+ eassert (NIL_IS_ZERO);
+ n = emit_rvalue_from_long_long (0);
+#else
+ n = gcc_jit_context_new_rvalue_from_ptr (comp.ctxt,
+ comp.void_ptr_type,
+ NULL);
+#endif
+ return emit_coerce (comp.lisp_obj_type, n);
+ }
+
imm_reloc_t reloc = obj_to_reloc (obj);
return
gcc_jit_lvalue_as_rvalue (
@@ -1319,12 +1328,15 @@ emit_mvar_val (Lisp_Object mvar)
/* We can still emit directly objects that are self-contained in a
word (read fixnums). */
emit_comment (SSDATA (Fprin1_to_string (constant, Qnil)));
- gcc_jit_rvalue *word =
- (sizeof (MOST_POSITIVE_FIXNUM) > sizeof (void *))
- ? emit_rvalue_from_long_long (constant)
- : gcc_jit_context_new_rvalue_from_long (comp.ctxt,
- comp.void_ptr_type,
- constant);
+ gcc_jit_rvalue *word;
+#ifdef WIDE_EMACS_INT
+ word = emit_rvalue_from_long_long (constant);
+#else
+ word =
+ gcc_jit_context_new_rvalue_from_ptr (comp.ctxt,
+ comp.void_ptr_type,
+ constant);
+#endif
return emit_coerce (comp.lisp_obj_type, word);
}
/* Other const objects are fetched from the reloc array. */