emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 14e6268 1/3: * Pacify GCC warning on non wide-int co


From: Andrea Corallo
Subject: feature/native-comp 14e6268 1/3: * Pacify GCC warning on non wide-int configurations
Date: Fri, 19 Feb 2021 17:02:58 -0500 (EST)

branch: feature/native-comp
commit 14e6268d141b8c54001d1d5bdcf610313ac9c447
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * Pacify GCC warning on non wide-int configurations
    
        * src/comp.c (emit_rvalue_from_emacs_uint)
        (emit_rvalue_from_lisp_word_tag): Pacify GCC warning.
        (emit_rvalue_from_unsigned_long_long): Define it only when
        necessary.
---
 src/comp.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/comp.c b/src/comp.c
index 3b1f3be..ca6e990 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -1128,6 +1128,7 @@ emit_rvalue_from_long_long (gcc_jit_type *type, long long 
n)
        low));
 }
 
+#if (EMACS_INT_MAX > LONG_MAX)
 static gcc_jit_rvalue *
 emit_rvalue_from_unsigned_long_long (gcc_jit_type *type, unsigned long long n)
 {
@@ -1169,16 +1170,18 @@ emit_rvalue_from_unsigned_long_long (gcc_jit_type 
*type, unsigned long long n)
                                                     32)),
              low));
 }
+#endif
 
 static gcc_jit_rvalue *
 emit_rvalue_from_emacs_uint (EMACS_UINT val)
 {
+#ifdef WIDE_EMACS_INT
   if (val > LONG_MAX || val < LONG_MIN)
     return emit_rvalue_from_unsigned_long_long (comp.emacs_uint_type, val);
-  else
-    return gcc_jit_context_new_rvalue_from_long (comp.ctxt,
-                                                comp.emacs_uint_type,
-                                                val);
+#endif
+  return gcc_jit_context_new_rvalue_from_long (comp.ctxt,
+                                              comp.emacs_uint_type,
+                                              val);
 }
 
 static gcc_jit_rvalue *
@@ -1194,12 +1197,13 @@ emit_rvalue_from_emacs_int (EMACS_INT val)
 static gcc_jit_rvalue *
 emit_rvalue_from_lisp_word_tag (Lisp_Word_tag val)
 {
+#ifdef WIDE_EMACS_INT
   if (val > LONG_MAX || val < LONG_MIN)
     return emit_rvalue_from_unsigned_long_long (comp.lisp_word_tag_type, val);
-  else
-    return gcc_jit_context_new_rvalue_from_long (comp.ctxt,
-                                                comp.lisp_word_tag_type,
-                                                val);
+#endif
+  return gcc_jit_context_new_rvalue_from_long (comp.ctxt,
+                                              comp.lisp_word_tag_type,
+                                              val);
 }
 
 static gcc_jit_rvalue *



reply via email to

[Prev in Thread] Current Thread [Next in Thread]