From patchwork Wed Jul 21 07:15:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 59405 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 2AE3EB70A6 for ; Wed, 21 Jul 2010 17:15:46 +1000 (EST) Received: (qmail 27473 invoked by alias); 21 Jul 2010 07:15:44 -0000 Received: (qmail 27464 invoked by uid 22791); 21 Jul 2010 07:15:43 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from c2beaomr07.btconnect.com (HELO c2beaomr07.btconnect.com) (213.123.26.185) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Jul 2010 07:15:39 +0000 Received: from thor.office (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by c2beaomr07.btconnect.com with ESMTP id FDU23354; Wed, 21 Jul 2010 08:15:18 +0100 (BST) X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=0001.0A0B0301.4C469E86.0017, actions=tag Cc: gcc-patches@gcc.gnu.org Message-Id: <9DA9D36B-6A09-48E0-8B14-E4E41EE0A2D0@sandoe-acoustics.co.uk> From: IainS To: Richard Guenther In-Reply-To: Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [PATCH] Fix PR44941 Date: Wed, 21 Jul 2010 08:15:17 +0100 References: 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 Hi Richard, On 19 Jul 2010, at 13:42, Richard Guenther wrote: > > This fixes PR44941 by early handling arguments of size zero. With > MEM_REF type-punned cases can now be registers which we do not handle > properly. After fixing this you can now see that we can avoid > generating > the stack slot for the zero-sized arg completely. > > Bootstrapped and tested on x86_64-unknown-linux-gnu. Comments? > 2010-07-19 Richard Guenther > > PR middle-end/44941 > * expr.c (emit_block_move_hints): Move zero size check first. > Move asserts to more useful places. > * calls.c (load_register_parameters): Check for zero size. > > * gcc.c-torture/compile/pr44941.c: New testcase. > { > rtx mem = validize_mem (args[i].value); The change to calls.c caused some compat/* fails on powerpc*-darwin9. As discussed on irc, (hopefully I understood what was wanted) the attached patch restores powerpc... ... whilst compile.exp=pr44941.c still passes on i686-darwin9. bootstrapped on {i686,powerpc}-darwin9 OK for trunk? Iain /* Handle a BLKmode that needs shifting. */ Index: gcc/calls.c =================================================================== --- gcc/calls.c (revision 162339) +++ gcc/calls.c (working copy) @@ -1668,15 +1668,16 @@ load_register_parameters (struct arg_data *args, i emit_move_insn (gen_rtx_REG (word_mode, REGNO (reg) + j), args[i].aligned_regs[j]); - else if ((partial == 0 || args[i].pass_on_stack) - && size != 0) + else if (partial == 0 || args[i].pass_on_stack) { rtx mem = validize_mem (args[i].value); - /* Check for overlap with already clobbered argument area. */ + /* Check for overlap with already clobbered argument area, + providing that this has finite size. */ if (is_sibcall - && mem_overlaps_already_clobbered_arg_p (XEXP (args[i].value, 0), - size)) + && (size == 0 + || mem_overlaps_already_clobbered_arg_p ( + XEXP (args[i].value, 0), size))) *sibcall_failure = 1;