This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4 04/14] nvptx: fix output of _Bool global variables
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Jakub Jelinek <jakub at redhat dot com>, Dmitry Melnik <dm at ispras dot ru>
- Date: Wed, 28 Oct 2015 20:34:11 +0300 (MSK)
- Subject: Re: [gomp4 04/14] nvptx: fix output of _Bool global variables
- Authentication-results: sourceware.org; auth=none
- References: <1445366076-16082-1-git-send-email-amonakov at ispras dot ru> <1445366076-16082-5-git-send-email-amonakov at ispras dot ru> <5626A898 dot 5000703 at redhat dot com> <alpine dot LNX dot 2 dot 20 dot 1510202351250 dot 23517 at monopod dot intra dot ispras dot ru> <alpine dot LNX dot 2 dot 20 dot 1510281941030 dot 13239 at monopod dot intra dot ispras dot ru> <5630FE4D dot 8040803 at redhat dot com>
On Wed, 28 Oct 2015, Bernd Schmidt wrote:
> On 10/28/2015 05:54 PM, Alexander Monakov wrote:
> > --- a/gcc/config/nvptx/nvptx.c
> > +++ b/gcc/config/nvptx/nvptx.c
> > @@ -1893,7 +1893,7 @@ init_output_initializer (FILE *file, const char *name,
> > const_tree type,
> > && TREE_CODE (type) != REAL_TYPE)
> > | | sz < 0
> > | | sz > HOST_BITS_PER_WIDE_INT)
> > - type = ptr_type_node;
> > + type = char_type_node;
> > decl_chunk_size = int_size_in_bytes (type);
> > decl_chunk_mode = int_mode_for_mode (TYPE_MODE (type));
> > decl_offset = 0;
>
> The idea here was that if you have a struct with a pointer field, and an
> initialization of it that uses a symbolic address, you'd be able to output the
> initializer. I don't quite see how that would still work after your patch.
>
> You say "with no libgomp testsuite regressions", did you run any other tests?
I didn't; a simple test exercising pointer fields appears to fail, indeed. So
what's the way forward here? Unless packed, a structure with pointer fields
will have size divisible by sizeof(void*), so can we simply pick the largest
PTX type evenly dividing the size of the original type?
Thanks.
Alexander