From patchwork Fri Jun 14 08:38:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 251268 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id A67472C0084 for ; Fri, 14 Jun 2013 18:38:52 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=VH1Oo/Br0EkVkBnNF +bDL8crb0JVTKSOy6jkJAPSCBfBm0f9Bx2EOpdB0DxINb9kw4g78wNDkXU+PBX7Y J2bw3vEuf26eVuPpJj0UlgM4vU2fCe4s4xy81w8p4VvKK5yYyQhKW4IELfbBeFN7 LsB+3fhfWaBHOkEfibtqFq/WKk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=tuSio9Z7bWzJzrpxlAvu3Cz bzHU=; b=XD+tAI+Yoc+53fZkGn0sUQQek1aKtpGabtZ+aohsFPwhO/f725b2DBd Jv59Hj74XwWMEZTjOwb41rtP+5oDSnqbW5PjhWCn5+8ypd3w3kgt6eT6k+aOCjny xfP3VpspWQOAvhw6C28tPUj6LSNxrajX+yPZg/zvin+Do1tYsse0= Received: (qmail 838 invoked by alias); 14 Jun 2013 08:38:45 -0000 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 Received: (qmail 805 invoked by uid 89); 14 Jun 2013 08:38:41 -0000 X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS autolearn=ham version=3.3.1 Received: from mail-pb0-f43.google.com (HELO mail-pb0-f43.google.com) (209.85.160.43) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 14 Jun 2013 08:38:40 +0000 Received: by mail-pb0-f43.google.com with SMTP id md12so363479pbc.2 for ; Fri, 14 Jun 2013 01:38:39 -0700 (PDT) X-Received: by 10.68.191.167 with SMTP id gz7mr1540395pbc.16.1371199119021; Fri, 14 Jun 2013 01:38:39 -0700 (PDT) Received: from bubble.grove.modra.org ([101.166.26.37]) by mx.google.com with ESMTPSA id v7sm1445816pbq.32.2013.06.14.01.38.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Jun 2013 01:38:37 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 42BD9EA009D; Fri, 14 Jun 2013 18:08:33 +0930 (CST) Date: Fri, 14 Jun 2013 18:08:33 +0930 From: Alan Modra To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: expand_expr tweaks to fix PR57134 Message-ID: <20130614083832.GK21523@bubble.grove.modra.org> Mail-Followup-To: Richard Biener , gcc-patches@gcc.gnu.org References: <20130612024834.GY6878@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) On Thu, Jun 13, 2013 at 10:45:38AM +0200, Richard Biener wrote: > On Wed, Jun 12, 2013 at 4:48 AM, Alan Modra wrote: > > The following patch fixes PR57134 by > > a) excluding bitfield expansion when EXPAND_MEMORY, and > > b) passing down the EXPAND_MEMORY modifier in a couple of places where > > this does not currently happen on recursive calls to expand_expr(). > > I suppose it also fixes PR57586 which looks similar? Not completely. It cures the ICE, but you still get "output number 0 not directly addressable". The reason being that expand_asm_operands isn't asking for a mem. It should I guess, and also not specify EXPAND_WRITE on an inout parameter. Bootstrapped and regression tested powerpc64-linux. PR middle-end/57586 * stmt.c (expand_asm_operands): Call expand_expr with EXPAND_MEMORY for output operands that disallow regs. Don't use EXPAND_WRITE on inout operands. > Ok with a testcase and mentioning PR57586 in the changelog. gcc.dg/compile/pr57134.c added. Index: gcc/stmt.c =================================================================== --- gcc/stmt.c (revision 200083) +++ gcc/stmt.c (working copy) @@ -807,7 +807,10 @@ expand_asm_operands (tree string, tree outputs, tr || ! allows_reg || is_inout) { - op = expand_expr (val, NULL_RTX, VOIDmode, EXPAND_WRITE); + op = expand_expr (val, NULL_RTX, VOIDmode, + !allows_reg ? EXPAND_MEMORY + : !is_inout ? EXPAND_WRITE + : EXPAND_NORMAL); if (MEM_P (op)) op = validize_mem (op);