Due to special treatment of types, emitting variables of type _Bool in
global scope is impossible: extern references are emitted with .u8, but
definitions use .u64.  This patch fixes the issue by treating boolean type as
integer types.

        * config/nvptx/nvptx.c (init_output_initializer): Also accept
        BOOLEAN_TYPE.
---
 gcc/config/nvptx/nvptx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 779b018..cfb5c4f 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -1863,6 +1863,7 @@ init_output_initializer (FILE *file, const char *name, 
const_tree type,
   int sz = int_size_in_bytes (type);
   if ((TREE_CODE (type) != INTEGER_TYPE
        && TREE_CODE (type) != ENUMERAL_TYPE
+       && TREE_CODE (type) != BOOLEAN_TYPE
        && TREE_CODE (type) != REAL_TYPE)
       || sz < 0
       || sz > HOST_BITS_PER_WIDE_INT)

Reply via email to