From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7300 invoked by alias); 18 Mar 2016 17:49:04 -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 7249 invoked by uid 89); 18 Mar 2016 17:49:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Maintain, 9467, Hx-languages-length:1971 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; Fri, 18 Mar 2016 17:48:54 +0000 Received: from condor.intra.ispras.ru (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id E619522775 for ; Fri, 18 Mar 2016 20:48:47 +0300 (MSK) Received: by condor.intra.ispras.ru (Postfix, from userid 23246) id 8E6651220773; Fri, 18 Mar 2016 20:48:47 +0300 (MSK) From: Alexander Monakov To: gcc-patches@gcc.gnu.org Subject: [gomp-nvptx 5/7] nvptx backend: use POINTER_SIZE instead of BITS_PER_WORD Date: Fri, 18 Mar 2016 17:49:00 -0000 Message-Id: <1458323327-9908-6-git-send-email-amonakov@ispras.ru> In-Reply-To: <1458323327-9908-1-git-send-email-amonakov@ispras.ru> References: <1458323327-9908-1-git-send-email-amonakov@ispras.ru> X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg01111.txt.bz2 POINTER_SIZE is the proper macro to retrieve pointer size in bits for the target ABI, but new code incorrectly used BITS_PER_WORD, breaking 32-bit code generation. * config/nvptx/nvptx.c (nvptx_init_unisimt_predicate): Use POINTER_SIZE instead of BITS_PER_WORD. (nvptx_declare_function_name): Ditto. (nvptx_output_return): Ditto. (nvptx_file_end): Ditto. --- gcc/ChangeLog.gomp-nvptx | 8 ++++++++ gcc/config/nvptx/nvptx.c | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index e69e0be..93bf781 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -946,7 +946,7 @@ nvptx_init_axis_predicate (FILE *file, int regno, const char *name) static void nvptx_init_unisimt_predicate (FILE *file) { - int bits = BITS_PER_WORD; + int bits = POINTER_SIZE; int master = REGNO (cfun->machine->unisimt_master); int pred = REGNO (cfun->machine->unisimt_predicate); fprintf (file, "\t{\n"); @@ -1108,7 +1108,7 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl) /* Maintain 64-bit stack alignment. */ int keep_align = BIGGEST_ALIGNMENT / BITS_PER_UNIT; sz = ROUND_UP (sz, keep_align); - int bits = BITS_PER_WORD; + int bits = POINTER_SIZE; fprintf (file, "\t.reg.u%d %%frame;\n", bits); fprintf (file, "\t.reg.u32 %%fstmp0;\n"); fprintf (file, "\t.reg.u%d %%fstmp1;\n", bits); @@ -1177,7 +1177,7 @@ nvptx_output_return (void) if (cfun->machine->using_softstack) fprintf (asm_out_file, "\tst.shared.u%d [%%fstmp2], %%fstmp1;\n", - BITS_PER_WORD); + POINTER_SIZE); if (mode != VOIDmode) fprintf (asm_out_file, "\tst.param%s\t[%s_out], %s;\n", @@ -4191,7 +4191,7 @@ nvptx_file_end (void) { write_var_marker (asm_out_file, false, true, "__nvptx_stacks"); fprintf (asm_out_file, ".extern .shared .u%d __nvptx_stacks[32];\n", - BITS_PER_WORD); + POINTER_SIZE); } if (need_unisimt_decl) {