From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1058 invoked by alias); 23 Aug 2015 14:46:02 -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 1046 invoked by uid 89); 23 Aug 2015 14:46:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qk0-f176.google.com Received: from mail-qk0-f176.google.com (HELO mail-qk0-f176.google.com) (209.85.220.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 23 Aug 2015 14:46:00 +0000 Received: by qkbm65 with SMTP id m65so54727767qkb.2 for ; Sun, 23 Aug 2015 07:45:58 -0700 (PDT) X-Received: by 10.55.50.7 with SMTP id y7mr43067276qky.86.1440341158443; Sun, 23 Aug 2015 07:45:58 -0700 (PDT) Received: from ?IPv6:2601:181:c000:c497:a2a8:cdff:fe3e:b48? ([2601:181:c000:c497:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id o2sm9048066qkl.38.2015.08.23.07.45.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Aug 2015 07:45:57 -0700 (PDT) To: GCC Patches Cc: Bernd Schmidt From: Nathan Sidwell Subject: [nvptx] fix complex args Message-ID: <55D9DCA4.2000305@acm.org> Date: Sun, 23 Aug 2015 16:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030506040907070500010009" X-SW-Source: 2015-08/txt/msg01373.txt.bz2 This is a multi-part message in MIME format. --------------030506040907070500010009 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 278 I've committed this patch, which fixes gcc.dg/compat/struct-by-value-11 That test passes 'complex char', which is split into two char arguments. We fail to promote the type in one place, leading to a PTX type mismatch where we claim an 8 bit type is a 32 bit type. nathan --------------030506040907070500010009 Content-Type: text/x-patch; name="ptx-cplx.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ptx-cplx.patch" Content-length: 1827 2015-08-23 Nathan Sidwell * config/nvptx/nvptx.c (walk_args_for_param): Promote arg reg decls. (nvptx_declare_function_name): Insert formatting tabs for consistency. Index: config/nvptx/nvptx.c =================================================================== --- config/nvptx/nvptx.c (revision 227101) +++ config/nvptx/nvptx.c (working copy) @@ -1,4 +1,3 @@ - /* Target code for NVPTX. Copyright (C) 2014-2015 Free Software Foundation, Inc. Contributed by Bernd Schmidt @@ -413,10 +412,10 @@ walk_args_for_param (FILE *file, tree ar i++; if (write_copy) fprintf (file, "\tld.param%s %%ar%d, [%%in_ar%d];\n", - nvptx_ptx_type_from_mode (mode, false), i, i); + nvptx_ptx_type_from_mode (mode, true), i, i); else fprintf (file, "\t.reg%s %%ar%d;\n", - nvptx_ptx_type_from_mode (mode, false), i); + nvptx_ptx_type_from_mode (mode, true), i); } } } @@ -546,7 +545,7 @@ nvptx_declare_function_name (FILE *file, else if (TYPE_MODE (result_type) != VOIDmode) { machine_mode mode = arg_promotion (TYPE_MODE (result_type)); - fprintf (file, ".reg%s %%retval;\n", + fprintf (file, "\t.reg%s %%retval;\n", nvptx_ptx_type_from_mode (mode, false)); } @@ -618,10 +617,10 @@ nvptx_declare_function_name (FILE *file, walk_args_for_param (file, TYPE_ARG_TYPES (fntype), DECL_ARGUMENTS (decl), true, return_in_mem); if (return_in_mem) - fprintf (file, "ld.param.u%d %%ar1, [%%in_ar1];\n", + fprintf (file, "\tld.param.u%d %%ar1, [%%in_ar1];\n", GET_MODE_BITSIZE (Pmode)); if (stdarg_p (fntype)) - fprintf (file, "ld.param.u%d %%argp, [%%in_argp];\n", + fprintf (file, "\tld.param.u%d %%argp, [%%in_argp];\n", GET_MODE_BITSIZE (Pmode)); } --------------030506040907070500010009--