From patchwork Mon Jun 16 10:57:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 360066 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5D6AD1400AA for ; Mon, 16 Jun 2014 20:57:36 +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 :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=i1NZN+supkRRC/g3w6dgPvGR1lNcTkFSfEcXt9ZWmaate3 JlPJbv+eA9sNjtiGIfAhE4JYwEYeQGEbhRduhN9+llGicRrpj1ppONfAIXLCnVrT dbNvsdM4A7N396Qpu3YAZSiJR+jk9YHpLXvMy4qMVwlDZVsNXEIIYO7oxXLRc= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=JFdbtIbXNDGHJPFqiPRkKP92c/Q=; b=lUUTs9VIVv/jyX+M9yAq k/Lo7Y4ck2XmQhQEnRa/QtpONKaEpHztiLG8Qdb3V1aExYd7E0S7URXbBRAFt0w8 +sMkwBXPGmBo4cJ3zvtPOAU4vAgbBm2IJHDNYH8VBMPH37MASU9d37a4pVmR9yB6 hL7GNdFMcpepp1Hf769I7W0= Received: (qmail 19122 invoked by alias); 16 Jun 2014 10:57:29 -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 19109 invoked by uid 89); 16 Jun 2014 10:57:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Jun 2014 10:57:28 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WwUbM-0003Rl-MT from Bernd_Schmidt@mentor.com for gcc-patches@gcc.gnu.org; Mon, 16 Jun 2014 03:57:24 -0700 Received: from SVR-IES-FEM-03.mgc.mentorg.com ([137.202.0.108]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 16 Jun 2014 03:57:24 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-03.mgc.mentorg.com (137.202.0.108) with Microsoft SMTP Server id 14.2.247.3; Mon, 16 Jun 2014 11:57:22 +0100 Message-ID: <539ECD8C.2030701@codesourcery.com> Date: Mon, 16 Jun 2014 12:57:16 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: GCC Patches Subject: Regimplification enhancements 2/3 This fixes an issue that showed up when regimplifying a call with a WITH_SIZE_EXPR for one of its arguments. At the moment we can end up trying to make a temporary and aborting because we don't know what size it ought to be. The problem is that we call gimplify_expr with the wrong predicate: gimplify_arg uses is_gimple_lvalue in some cases instead of is_gimple_val, and regimplification needs to match that. Bootstrapped and tested on x86_64-linux, ok? Bernd commit c1296ac4f4e7e8f0fb9c87d71ca8194a8eac0067 Author: Bernd Schmidt Date: Wed Jun 11 18:41:09 2014 +0200 Fix an issue with regimplification. gcc/ * gimplify-me.c (gimple_regimplify_operands): Ensure that for calls we use the same predicate as in gimplify_arg. diff --git a/gcc/gimplify-me.c b/gcc/gimplify-me.c index 467ec6c..05eaeb0 100644 --- a/gcc/gimplify-me.c +++ b/gcc/gimplify-me.c @@ -245,7 +245,17 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p) gimplify_expr (&op, &pre, NULL, is_gimple_call_addr, fb_rvalue); } else - gimplify_expr (&op, &pre, NULL, is_gimple_val, fb_rvalue); + { + bool (*test) (tree) = is_gimple_val; + fallback_t fb = fb_rvalue; + if (is_gimple_call (stmt) + && !is_gimple_reg_type (TREE_TYPE (op))) + { + test = is_gimple_lvalue; + fb = fb_either; + } + gimplify_expr (&op, &pre, NULL, test, fb); + } gimple_set_op (stmt, i - 1, op); } if (is_gimple_assign (stmt)