From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24333 invoked by alias); 9 Oct 2015 05:36:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 24318 invoked by uid 89); 9 Oct 2015 05:36:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 09 Oct 2015 05:36:44 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 7F188C0B83CE; Fri, 9 Oct 2015 05:36:43 +0000 (UTC) Received: from freie.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t995ae1V024823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 9 Oct 2015 01:36:42 -0400 Received: from livre.home (livre.home [172.31.160.2]) by freie.home (8.14.9/8.14.9) with ESMTP id t995aUd8001580; Fri, 9 Oct 2015 02:36:30 -0300 From: Alexandre Oliva To: =?utf-8?Q?Uro=C5=A1?= Bizjak , Richard Biener Cc: Alan Lawrence , Jeff Law , James Greenhalgh , "H.J. Lu" , Segher Boessenkool , GCC Patches , Christophe Lyon , David Edelsohn , Eric Botcazou Subject: [PR67766] reorder return value copying from PARALLELs and CONCATs (was: Re: [PR64164] drop copyrename, integrate into expand) References: <20150723203112.GB27818@gate.crashing.org> <20150810082355.GA31149@arm.com> <55C8BFC3.3030603@redhat.com> <55E72D4C.40705@arm.com> <55FC3171.7040509@arm.com> Date: Fri, 09 Oct 2015 05:36:00 -0000 In-Reply-To: (Richard Biener's message of "Fri, 25 Sep 2015 13:21:34 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-10/txt/msg00918.txt.bz2 This fixes fallout from the PR64164 expander revamp. On alpha, PARALLEL hard return values may be modeless, and this confuses the code that wants to copy the pseudo/s in the returned value to the return hard regs. It used to work because PARALLELs and CONCATs used to lead to DECL_RTL with the same mode, but now we try harder to create a pseudo or MEM with a reasonable mode. The solution was as simple as moving down the code that handled mode differences, so that PARALLELs and CONCATs are handled as they should. Since AFAICT they don't ever have to deal with mode promotion anyway, we should be fine with this simple change, that Uro=C5=A1 kindly tested with an alpha-linux-gnu regstrap. I tested it myself on x86_64-linux-gnu and i686-linux-gnu. Ok to install? [PR67766] reorder handling of parallels, concats and promoted values in ret= urn From: Alexandre Oliva for gcc/ChangeLog PR middle-end/67766 * function.c (expand_function_end): Move return value promotion past the handling of PARALLELs and CONCATs. --- gcc/function.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gcc/function.c b/gcc/function.c index e76ba2b..d16d6d8 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5446,18 +5446,6 @@ expand_function_end (void) decl_rtl); shift_return_value (GET_MODE (decl_rtl), true, real_decl_rtl); } - /* If a named return value dumped decl_return to memory, then - we may need to re-do the PROMOTE_MODE signed/unsigned - extension. */ - else if (GET_MODE (real_decl_rtl) !=3D GET_MODE (decl_rtl)) - { - int unsignedp =3D TYPE_UNSIGNED (TREE_TYPE (decl_result)); - promote_function_mode (TREE_TYPE (decl_result), - GET_MODE (decl_rtl), &unsignedp, - TREE_TYPE (current_function_decl), 1); - - convert_move (real_decl_rtl, decl_rtl, unsignedp); - } else if (GET_CODE (real_decl_rtl) =3D=3D PARALLEL) { /* If expand_function_start has created a PARALLEL for decl_rtl, @@ -5488,6 +5476,18 @@ expand_function_end (void) emit_move_insn (tmp, decl_rtl); emit_move_insn (real_decl_rtl, tmp); } + /* If a named return value dumped decl_return to memory, then + we may need to re-do the PROMOTE_MODE signed/unsigned + extension. */ + else if (GET_MODE (real_decl_rtl) !=3D GET_MODE (decl_rtl)) + { + int unsignedp =3D TYPE_UNSIGNED (TREE_TYPE (decl_result)); + promote_function_mode (TREE_TYPE (decl_result), + GET_MODE (decl_rtl), &unsignedp, + TREE_TYPE (current_function_decl), 1); + + convert_move (real_decl_rtl, decl_rtl, unsignedp); + } else emit_move_insn (real_decl_rtl, decl_rtl); } --=20 Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer