From patchwork Fri Mar 1 11:38:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 224287 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 956DF2C02AA for ; Fri, 1 Mar 2013 22:38:41 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1362742722; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:User-Agent:MIME-Version:Message-Id: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=Nm3K76X FNglh7hsHAame+cziu4Y=; b=oZ+EmoYFb75CJyRqqXpwfp6AC3JKNgWBs2mhsfz xp6OtvwF+88U15GotDRfrRtOIlFq/f8eYQliO/zFbpgE0pC1jDwTRWeskw3JCv3P w8Z69Z+XvUbnyLJfQDoJjQMl2W+/+NQpoX7j5/9/Ee3yON83fD3oTDi9rSRWkBDz yfiI= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:To:Subject:Date:User-Agent:MIME-Version:Message-Id:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=CLCooP5L2O01q3vhLrWbWqEBVy91fBbgRTxrOV1lyMMDL2XbGNNSaqS9Jc6IFh 8dsORBrRvNPGly1UuFl0olLhHxLJONWVoeYTzvWVo7KuKWviGepU+eBof0HdHxI7 8x+riiHF7E1mHb/3cpiMvfKKI7g2qVBZdkc0Pp8ChihwI=; Received: (qmail 18383 invoked by alias); 1 Mar 2013 11:38:35 -0000 Received: (qmail 18317 invoked by uid 22791); 1 Mar 2013 11:38:34 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,TW_FN X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Mar 2013 11:38:29 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 354902900B1 for ; Fri, 1 Mar 2013 12:38:27 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XHPpjFmBzKXI for ; Fri, 1 Mar 2013 12:38:27 +0100 (CET) Received: from hermes.site (ADijon-552-1-10-223.w92-138.abo.wanadoo.fr [92.138.21.223]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 0258D290008 for ; Fri, 1 Mar 2013 12:38:26 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Fix PR tree-optimization/56424 Date: Fri, 1 Mar 2013 12:38:05 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.34.10-0.6-desktop; KDE/4.4.4; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201303011238.05564.ebotcazou@adacore.com> 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, this is the ICE during the build of the Ada runtime on x86-64/Windows: the compiler stops on the assertion in declare_return_variable: var = return_slot; gcc_assert (TREE_CODE (var) != SSA_NAME); The problem stems for the fnsplit pass: it turns P.Sin (const long_long_float x) { long_long_float _3; boolean _4; q__double _9; : _3 = ABS_EXPR ; _4 = _3 < 1.0e+0; if (_4 != 0) goto ; else goto ; : = x_2(D); goto ; : _9 = q.sin (x_2(D)); = _9; : return ; } into P.Sin (const long_long_float x) { long_long_float _3; boolean _4; : _3 = ABS_EXPR ; _4 = _3 < 1.0e+0; if (_4 != 0) goto ; else goto ; : = x_2(D); goto ; : = p.sin.part (x_2(D)); [return slot optimization] : return ; } Note the RSO flag on the call to the split part: it's bogus since the return type is scalar: Fixed by checking that either the type of the result is not is_gimple_reg_type or the result is passed by reference before setting the RSO flag. Tested on x86_64-suse-linux, OK for the mainline? 2013-01-01 Eric Botcazou PR tree-optimization/56424 * ipa-split.c (split_function): Do not set the RSO flag if result is not by reference and its type is not a register type. 2013-01-01 Eric Botcazou * gcc.dg/pr56424.c: New test. Index: ipa-split.c =================================================================== --- ipa-split.c (revision 196253) +++ ipa-split.c (working copy) @@ -1309,7 +1309,9 @@ split_function (struct split_point *spli so return slot optimization is always possible. Moreover this is required to make DECL_BY_REFERENCE work. */ if (aggregate_value_p (DECL_RESULT (current_function_decl), - TREE_TYPE (current_function_decl))) + TREE_TYPE (current_function_decl)) + && (!is_gimple_reg_type (TREE_TYPE (DECL_RESULT (current_function_decl))) + || DECL_BY_REFERENCE (DECL_RESULT (current_function_decl)))) gimple_call_set_return_slot_opt (call, true); /* Update return value. This is bit tricky. When we do not return,