From patchwork Thu Oct 21 21:43:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 68782 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 1E4EAB70EC for ; Fri, 22 Oct 2010 08:43:15 +1100 (EST) Received: (qmail 23490 invoked by alias); 21 Oct 2010 21:43:14 -0000 Received: (qmail 23481 invoked by uid 22791); 21 Oct 2010 21:43:13 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Oct 2010 21:43:09 +0000 Received: (qmail 17596 invoked from network); 21 Oct 2010 21:43:07 -0000 Received: from unknown (HELO codesourcery.com) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 21 Oct 2010 21:43:07 -0000 Date: Thu, 21 Oct 2010 17:43:05 -0400 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Cc: uweigand@de.ibm.com Subject: [spu] fix spu_function_arg thinkos Message-ID: <20101021214303.GP2806@nightcrawler> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org When I made my FUNCTION_ARG hookization changes for spu, I didn't look very closely at the compiler warnings: if I had, I would have noticed that I changed the type of the CUM parameter without changing its uses. Fixed in the following way, verified with a cross to spu-elf. Committed as obvious. -Nathan * config/spu/spu.c (spu_function_arg): Dereference CUM parameter. Index: config/spu/spu.c =================================================================== --- config/spu/spu.c (revision 165789) +++ config/spu/spu.c (working copy) @@ -4021,7 +4021,7 @@ spu_function_arg (CUMULATIVE_ARGS *cum, { int byte_size; - if (cum >= MAX_REGISTER_ARGS) + if (*cum >= MAX_REGISTER_ARGS) return 0; byte_size = ((mode == BLKmode) @@ -4029,7 +4029,7 @@ spu_function_arg (CUMULATIVE_ARGS *cum, /* The ABI does not allow parameters to be passed partially in reg and partially in stack. */ - if ((cum + (byte_size + 15) / 16) > MAX_REGISTER_ARGS) + if ((*cum + (byte_size + 15) / 16) > MAX_REGISTER_ARGS) return 0; /* Make sure small structs are left justified in a register. */ @@ -4042,12 +4042,12 @@ spu_function_arg (CUMULATIVE_ARGS *cum, byte_size = 4; smode = smallest_mode_for_size (byte_size * BITS_PER_UNIT, MODE_INT); gr_reg = gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (smode, FIRST_ARG_REGNUM + cum), + gen_rtx_REG (smode, FIRST_ARG_REGNUM + *cum), const0_rtx); return gen_rtx_PARALLEL (mode, gen_rtvec (1, gr_reg)); } else - return gen_rtx_REG (mode, FIRST_ARG_REGNUM + cum); + return gen_rtx_REG (mode, FIRST_ARG_REGNUM + *cum); } static void