diff options
author | Antoni Boucher <bouanto@zoho.com> | 2022-06-29 19:56:56 -0400 |
---|---|---|
committer | Antoni Boucher <bouanto@zoho.com> | 2022-06-29 19:57:15 -0400 |
commit | e3a5c77388ae3791afed4f4286ec7e41e5b9f7c3 (patch) | |
tree | 8e87a2bd6f58c2ef0ea0f9407a39c74ec7cdf000 /gcc/jit | |
parent | 3183acc8e0452fbc0ad429a909811ca0308c86c9 (diff) | |
download | gcc-e3a5c77388ae3791afed4f4286ec7e41e5b9f7c3.zip gcc-e3a5c77388ae3791afed4f4286ec7e41e5b9f7c3.tar.gz gcc-e3a5c77388ae3791afed4f4286ec7e41e5b9f7c3.tar.bz2 |
libgccjit: Fix bug where unary_op will return an integer type instead of the correct type
2022-06-29 Antoni Boucher <bouanto@zoho.com>
gcc/jit/
PR jit/105812
* jit-playback.cc: Use the correct return type when folding in
as_truth_value.
gcc/testsuite/
PR jit/105812
* jit.dg/test-asm.cc: Add include missing to make the test pass.
* jit.dg/test-pr105812-bool-operations.c: New test.
Diffstat (limited to 'gcc/jit')
-rw-r--r-- | gcc/jit/jit-playback.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc index 7971413..d227d36 100644 --- a/gcc/jit/jit-playback.cc +++ b/gcc/jit/jit-playback.cc @@ -1024,8 +1024,9 @@ as_truth_value (tree expr, location *loc) if (loc) set_tree_location (typed_zero, loc); + tree type = TREE_TYPE (expr); expr = fold_build2_loc (UNKNOWN_LOCATION, - NE_EXPR, integer_type_node, expr, typed_zero); + NE_EXPR, type, expr, typed_zero); if (loc) set_tree_location (expr, loc); |