From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17114 invoked by alias); 18 Sep 2014 10:13:15 -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 17100 invoked by uid 89); 18 Sep 2014 10:13:14 -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,SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Sep 2014 10:13:13 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 18 Sep 2014 11:13:10 +0100 Received: from localhost ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 18 Sep 2014 11:13:10 +0100 From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [PATCH 3/5] Use simplify_subreg_regno in combine.c:subst References: <87ppetnsxd.fsf@e105548-lin.cambridge.arm.com> Date: Thu, 18 Sep 2014 10:13:00 -0000 In-Reply-To: <87ppetnsxd.fsf@e105548-lin.cambridge.arm.com> (Richard Sandiford's message of "Thu, 18 Sep 2014 11:07:10 +0100") Message-ID: <87d2atnsne.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-MC-Unique: 114091811131020501 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-09/txt/msg01445.txt.bz2 combine.c:subst should refuse to substitute a hard register into a subreg if the new subreg would not be simplified to a simple hard register, since the result would have to be reloaded. This is more for optimisation than correctness, since in theory the RA should be able to fix up any unsimplified subregs. gcc/ * combine.c (subst): Use simplify_subreg_regno rather than REG_CANNOT_CHANGE_MODE_P to detect invalid mode changes. Index: gcc/combine.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc/combine.c 2014-09-15 10:00:17.545330404 +0100 +++ gcc/combine.c 2014-09-15 10:00:17.545330404 +0100 @@ -5121,15 +5121,13 @@ #define COMBINE_RTX_EQUAL_P(X,Y) \ ) return gen_rtx_CLOBBER (VOIDmode, const0_rtx); =20 -#ifdef CANNOT_CHANGE_MODE_CLASS if (code =3D=3D SUBREG && REG_P (to) && REGNO (to) < FIRST_PSEUDO_REGISTER - && REG_CANNOT_CHANGE_MODE_P (REGNO (to), - GET_MODE (to), - GET_MODE (x))) + && simplify_subreg_regno (REGNO (to), GET_MODE (to), + SUBREG_BYTE (x), + GET_MODE (x)) < 0) return gen_rtx_CLOBBER (VOIDmode, const0_rtx); -#endif =20 new_rtx =3D (unique_copy && n_occurrences ? copy_rtx (to) : to); n_occurrences++;