diff options
| author | Vibhav Pant | 2022-10-05 01:01:50 +0530 |
|---|---|---|
| committer | Vibhav Pant | 2022-10-05 01:01:50 +0530 |
| commit | d23ed93dcbd97e3081b158f923610ae200706307 (patch) | |
| tree | c63e75f2a68ba4dbfafdccca642aceb5db84ae15 | |
| parent | f8b1ce318815159545f807c5e80a720921cfe584 (diff) | |
| download | emacs-feature/jit-improved-type-punning.tar.gz emacs-feature/jit-improved-type-punning.zip | |
Add comment explaining gcc_jit_context_new_bitcast usage.feature/jit-improved-type-punning
| -rw-r--r-- | src/comp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/comp.c b/src/comp.c index cd09a327a7b..38a6a57f5a8 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -1179,6 +1179,11 @@ emit_coerce (gcc_jit_type *new_type, gcc_jit_rvalue *obj) | |||
| 1179 | 1179 | ||
| 1180 | gcc_jit_rvalue *tmp = obj; | 1180 | gcc_jit_rvalue *tmp = obj; |
| 1181 | 1181 | ||
| 1182 | /* `gcc_jit_context_new_bitcast` requires that the types being converted | ||
| 1183 | between have the same layout and as such, doesn't allow converting | ||
| 1184 | between an arbitrarily sized integer/boolean and a pointer. Casting it | ||
| 1185 | to a uintptr/void* is still necessary, to ensure that it can be bitcast | ||
| 1186 | into a (void *)/uintptr respectively. */ | ||
| 1182 | if (old_is_ptr != new_is_ptr) | 1187 | if (old_is_ptr != new_is_ptr) |
| 1183 | { | 1188 | { |
| 1184 | if (old_is_ptr) | 1189 | if (old_is_ptr) |