Message ID | 1445366076-16082-5-git-send-email-amonakov@ispras.ru |
---|---|
State | New |
Headers | show |
On 10/20/2015 08:34 PM, Alexander Monakov wrote: > 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. Interesting, what was the testcase? I didn't stumble over this one. In any case, I think this patch is ok for trunk. Bernd
On Tue, 20 Oct 2015, Bernd Schmidt wrote: > On 10/20/2015 08:34 PM, Alexander Monakov wrote: > > 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. > > Interesting, what was the testcase? I didn't stumble over this one. In any > case, I think this patch is ok for trunk. libgomp has 'bool gomp_cancel_var' in global scope, and since it is not compiled with -ffunction-sections, GOMP_parallel pulls in GOMP_cancel (same TU, parallel.c), which references the variable. Anything with "#pragma omp parallel" would fail to link. Thanks. Alexander
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)