From patchwork Thu Jan 8 15:58:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kito Cheng X-Patchwork-Id: 426695 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 379CE14014D for ; Fri, 9 Jan 2015 02:59:37 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; q=dns; s=default; b=A0ox/A8/NvL3uX6 Cy9vmW0uCV2ansPnWPe1dEJsAlL/CO3uN3w2bw02T1vlxoQ21O7A64dthlgqoax5 FN5OWXT+qPvQnPMmNkCUpP7tnUhj+T0sScVpW40klSEZOwl3UOu2kukX9GLxEsyB er6/k5Z0SSbCjqiIfy2fjbyAnp10= 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 :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; s=default; bh=yOirgxg0I4ZwUXK6lwLJf 0ycFSc=; b=pReMRcHh08NLBL+aQC3FmDH5ZUUxXKNMIjSWoX6u1dc/63NU0s3Gd tx77hO0vZeqGP/lCT/1/p9PWKY68G/CHTSD31J3ltHRU+4A4Bdr3PsHjxqi0Ojoi +3PODUEbpWkVvs2KMDIxYTRupVWywcNBV7gX5ct2kCi/eBpASfI01U= Received: (qmail 10545 invoked by alias); 8 Jan 2015 15:59:30 -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 10534 invoked by uid 89); 8 Jan 2015 15:59:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f178.google.com Received: from mail-ig0-f178.google.com (HELO mail-ig0-f178.google.com) (209.85.213.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 08 Jan 2015 15:59:22 +0000 Received: by mail-ig0-f178.google.com with SMTP id b16so3466486igk.5 for ; Thu, 08 Jan 2015 07:59:20 -0800 (PST) X-Received: by 10.50.234.194 with SMTP id ug2mr28839359igc.39.1420732760327; Thu, 08 Jan 2015 07:59:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.1.52 with HTTP; Thu, 8 Jan 2015 07:58:59 -0800 (PST) In-Reply-To: References: <54AACA79.5060008@redhat.com> <54AB1FFE.30707@redhat.com> <54ACB768.4070609@redhat.com> From: Kito Cheng Date: Thu, 8 Jan 2015 23:58:59 +0800 Message-ID: Subject: Re: [PATCH] LRA: Fix caller-save store/restore instruction for large mode To: "Bin.Cheng" Cc: Vladimir Makarov , Jeff Law , "gcc-patches@gcc.gnu.org" , Bin Cheng X-IsSubscribed: yes Hi Jeff: After discussion with Bin, he prefer just use gcc.c-torture/execute/scal-to-vec1.c instead of introduce new one, do you have any further comment on this patch? On Thu, Jan 8, 2015 at 9:29 AM, Bin.Cheng wrote: > On Wed, Jan 7, 2015 at 8:28 PM, Kito Cheng wrote: >> Hi Bin: >> >> It's 2 more line than gcc.c-torture/execute/scal-to-vec1.c since it's >> need specific compilation >> flag and specific target to reproduce this issue, >> and it's can't reproduce by normal testing flow with >> arm-*-linux-gnueabi (due to lack -fPIC flag), >> so I prefer duplicate this case into gcc.target/arm/ :) >> >> /* { dg-do compile } */ >> /* { dg-options "-O3 -fPIC -marm -mcpu=cortex-a8" } */ > Not really, we generally want to avoid cpu related options in testcase > since it introduces conflict option failures when testing against > specific processor, e.g. testing against Cortex-M profile processors. > > Thanks, > bin > >> >> On Wed, Jan 7, 2015 at 4:50 PM, Bin.Cheng wrote: >>> On Wed, Jan 7, 2015 at 4:03 PM, Kito Cheng wrote: >>>> Hi Jeff: >>>> >>>> It's updated patch,bootstrapped and run regression tested on arm-eabi, >>>> arm-none-linux-uclibcgnueabi, x86_64-unknown-linux-gnu and nds32le-elf >>>> without introducing regression. >>>> >>>> Thanks for your review :) >>>> >>>> 2015-01-07 Kito Cheng >>>> >>>> PR target/64348 >>>> * lra-constraints.c (split_reg): Fix caller-save store/restore >>>> instruction generation. >>> >>> Thanks for fixing the issue. >>> The PR is against existing testcase failure >>> gcc.c-torture/execute/scal-to-vec1.c. Unless we can create a new >>> case, there is no need to include same case twice I think? Or we can >>> mention the PR number in the original test case? >>> >>> Thanks, >>> bin From 98f58cca618a99e282c7add2ecbe59002c867c60 Mon Sep 17 00:00:00 2001 From: Kito Cheng Date: Thu, 29 May 2014 23:53:23 +0800 Subject: [PATCH] Fix caller-save store/restore instruction for large mode in lra - The original code assume store/restore will always have only one insn, it's will fail if you split in move pattern!!! --- gcc/lra-constraints.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 96b10a1..f8bc12f 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -4918,15 +4918,14 @@ split_reg (bool before_p, int original_regno, rtx_insn *insn, reg_renumber[REGNO (new_reg)] = hard_regno; } save = emit_spill_move (true, new_reg, original_reg); - if (NEXT_INSN (save) != NULL_RTX) + if (NEXT_INSN (save) != NULL_RTX && !call_save_p) { - lra_assert (! call_save_p); if (lra_dump_file != NULL) { fprintf (lra_dump_file, - " Rejecting split %d->%d resulting in > 2 %s save insns:\n", - original_regno, REGNO (new_reg), call_save_p ? "call" : ""); + " Rejecting split %d->%d resulting in > 2 save insns:\n", + original_regno, REGNO (new_reg)); dump_rtl_slim (lra_dump_file, save, NULL, -1, 0); fprintf (lra_dump_file, " ))))))))))))))))))))))))))))))))))))))))))))))))\n"); @@ -4934,15 +4933,14 @@ split_reg (bool before_p, int original_regno, rtx_insn *insn, return false; } restore = emit_spill_move (false, new_reg, original_reg); - if (NEXT_INSN (restore) != NULL_RTX) + if (NEXT_INSN (restore) != NULL_RTX && !call_save_p) { - lra_assert (! call_save_p); if (lra_dump_file != NULL) { fprintf (lra_dump_file, " Rejecting split %d->%d " - "resulting in > 2 %s restore insns:\n", - original_regno, REGNO (new_reg), call_save_p ? "call" : ""); + "resulting in > 2 restore insns:\n", + original_regno, REGNO (new_reg)); dump_rtl_slim (lra_dump_file, restore, NULL, -1, 0); fprintf (lra_dump_file, " ))))))))))))))))))))))))))))))))))))))))))))))))\n"); -- 1.8.3.1.549.g1f3a412