From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13903 invoked by alias); 4 Apr 2013 15:46:40 -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 13875 invoked by uid 89); 4 Apr 2013 15:46:39 -0000 X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 04 Apr 2013 15:46:36 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 04 Apr 2013 16:46:34 +0100 Received: from [10.1.69.70] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 4 Apr 2013 16:46:31 +0100 Message-ID: <515DA057.7070108@arm.com> Date: Thu, 04 Apr 2013 19:50:00 -0000 From: Ramana Radhakrishnan User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Jakub Jelinek CC: gcc-patches@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [Patch 4.6 only] Fix PR48308. References: <515D7C0B.8040504@arm.com> <20130404131637.GO4201@tucnak.redhat.com> In-Reply-To: <20130404131637.GO4201@tucnak.redhat.com> X-MC-Unique: 113040416463408401 Content-Type: multipart/mixed; boundary="------------000305010405090501090009" X-Virus-Found: No X-SW-Source: 2013-04/txt/msg00263.txt.bz2 This is a multi-part message in MIME format. --------------000305010405090501090009 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 611 On 04/04/13 14:16, Jakub Jelinek wrote: > On Thu, Apr 04, 2013 at 02:11:39PM +0100, Ramana Radhakrishnan wrote: >> >> This backports the fix for PR48308 something that's slipped through >> the cracks. I wrote the backport and then noticed that Mikael had a >> similar solution - the only difference being around this guarded for >> HAVE_cc0 targets. >> >> Tested cross arm-none-linux-gnueabi - no regressions. >> >> Bootstrapped with i686-pc-linux-gnu , regression tests running. >> >> Ok to commit if no regressions ? > > Ok. > > Jakub > Thanks - this is what I will commit once testing completes. Ramana --------------000305010405090501090009 Content-Type: text/plain; charset=WINDOWS-1252; name=gcc46-pr48308.txt Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="gcc46-pr48308.txt" Content-length: 2589 Index: 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 --- combine.c (revision 197476) +++ combine.c (working copy) @@ -341,14 +341,14 @@ /* Record one modification to rtl structure to be undone by storing old_contents into *where. */ =20 -enum undo_kind { UNDO_RTX, UNDO_INT, UNDO_MODE }; +enum undo_kind { UNDO_RTX, UNDO_INT, UNDO_MODE, UNDO_LINKS }; =20 struct undo { struct undo *next; enum undo_kind kind; union { rtx r; int i; enum machine_mode m; } old_contents; - union { rtx *r; int *i; } where; + union { rtx *r; int *i; } where; }; =20 /* Record a bunch of changes to be undone, up to MAX_UNDO of them. @@ -671,7 +671,8 @@ that are perfectly valid, so we'd waste too much effort for little gain doing the checks here. Focus on catching invalid transformations involving integer constants. */ - if (GET_MODE_CLASS (GET_MODE (oldval)) =3D=3D MODE_INT + if (oldval + && GET_MODE_CLASS (GET_MODE (oldval)) =3D=3D MODE_INT && CONST_INT_P (newval)) { /* Sanity check that we're replacing oldval with a CONST_INT @@ -762,6 +763,34 @@ } =20 #define SUBST_MODE(INTO, NEWVAL) do_SUBST_MODE(&(INTO), (NEWVAL)) + +#ifndef HAVE_cc0 + +/* Similar to SUBST, but NEWVAL is a LOG_LINKS expression. */ + +static void +do_SUBST_LINK (rtx *into, rtx newval) +{ + struct undo *buf; + rtx oldval =3D *into; + if (oldval =3D=3D newval) + return; + + if (undobuf.frees) + buf =3D undobuf.frees, undobuf.frees =3D buf->next; + else + buf =3D XNEW (struct undo); +=20=20 + buf->kind =3D UNDO_LINKS; + buf->where.r =3D into; + buf->old_contents.r =3D oldval; + *into =3D newval; +=20=20 + buf->next =3D undobuf.undos, undobuf.undos =3D buf; +} + +#define SUBST_LINK(oldval, newval) do_SUBST_LINK (&oldval, newval) +#endif =0C /* Subroutine of try_combine. Determine whether the combine replacement patterns NEWPAT, NEWI2PAT and NEWOTHERPAT are cheaper according to @@ -2871,6 +2900,7 @@ SUBST (PATTERN (i2), XVECEXP (PATTERN (i2), 0, 0)); SUBST (XEXP (SET_SRC (PATTERN (i2)), 0), SET_DEST (PATTERN (i1))); + SUBST_LINK (LOG_LINKS (i2), alloc_INSN_LIST (i1, LOG_LINKS (i2))); } } #endif @@ -4474,6 +4504,11 @@ case UNDO_MODE: adjust_reg_mode (*undo->where.r, undo->old_contents.m); break; + + case UNDO_LINKS: + *undo->where.r =3D undo->old_contents.r; + break; + default: gcc_unreachable (); }= --------------000305010405090501090009--