From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72832 invoked by alias); 28 Oct 2015 17:34:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 72823 invoked by uid 89); 28 Oct 2015 17:34:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: smtp.ispras.ru Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.199.79) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Oct 2015 17:34:14 +0000 Received: from [10.10.3.121] (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id BE33720514; Wed, 28 Oct 2015 20:34:11 +0300 (MSK) Date: Wed, 28 Oct 2015 17:38:00 -0000 From: Alexander Monakov To: Bernd Schmidt cc: gcc-patches@gcc.gnu.org, Jakub Jelinek , Dmitry Melnik Subject: Re: [gomp4 04/14] nvptx: fix output of _Bool global variables In-Reply-To: <5630FE4D.8040803@redhat.com> Message-ID: References: <1445366076-16082-1-git-send-email-amonakov@ispras.ru> <1445366076-16082-5-git-send-email-amonakov@ispras.ru> <5626A898.5000703@redhat.com> <5630FE4D.8040803@redhat.com> User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2015-10/txt/msg03078.txt.bz2 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