[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/jit-improved-type-punning d23ed93dcb: Add comment explaining gcc
From: |
Vibhav Pant |
Subject: |
feature/jit-improved-type-punning d23ed93dcb: Add comment explaining gcc_jit_context_new_bitcast usage. |
Date: |
Tue, 4 Oct 2022 15:32:17 -0400 (EDT) |
branch: feature/jit-improved-type-punning
commit d23ed93dcbd97e3081b158f923610ae200706307
Author: Vibhav Pant <vibhavp@gmail.com>
Commit: Vibhav Pant <vibhavp@gmail.com>
Add comment explaining gcc_jit_context_new_bitcast usage.
---
src/comp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/comp.c b/src/comp.c
index cd09a327a7..38a6a57f5a 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -1179,6 +1179,11 @@ emit_coerce (gcc_jit_type *new_type, gcc_jit_rvalue *obj)
gcc_jit_rvalue *tmp = obj;
+ /* `gcc_jit_context_new_bitcast` requires that the types being converted
+ between have the same layout and as such, doesn't allow converting
+ between an arbitrarily sized integer/boolean and a pointer. Casting it
+ to a uintptr/void* is still necessary, to ensure that it can be bitcast
+ into a (void *)/uintptr respectively. */
if (old_is_ptr != new_is_ptr)
{
if (old_is_ptr)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- feature/jit-improved-type-punning d23ed93dcb: Add comment explaining gcc_jit_context_new_bitcast usage.,
Vibhav Pant <=