From patchwork Tue Apr 7 19:28:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yvan Roux X-Patchwork-Id: 46848 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C8FAA214BA for ; Tue, 7 Apr 2015 19:29:14 +0000 (UTC) Received: by layy10 with SMTP id y10sf15094502lay.0 for ; Tue, 07 Apr 2015 12:29:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:mime-version:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-original-sender :x-original-authentication-results; bh=L45ZEq29jezDbouGqKtPxmb3Rh2QTFV/xC+osDNMzT0=; b=gPJdGAASU2sih3tS3ucmY2MBe8WRgLd4c83ACAnB+i+HSW0Gac57Nital3jEHAH7hZ lHkwuH5YZoHl1evkbxbLx691vp3CcFuGDaEuTc9W/TBkj34+9/WSU2YBGT4+d/iEHfIz IvmN7BKOInEnzjpOscpfzOLlWnYynwJ/x76Zv88riFpyIqg1z+7XlZFXOT3yK5OEoKQQ xpSrzaHyD8eGhX7WLVCXZwEgURF6DB4UbcdCWAXnX5pk1+bR8MAxiEdBsH7XaiQQ/MH3 aIkRZcRhxU9ZHlq8iwlotjLvVipfc9osonHM8ZkY07doPJuJI6f4zWO5iWlQIeNEIwyu GjkA== X-Gm-Message-State: ALoCoQkm8FuhMrybFGNVv8mmTRgj+gC2OLKmaVSalcj6iCvRkB7A/2rX/bN1SYRQvl+rjdQc8B1H X-Received: by 10.112.203.168 with SMTP id kr8mr1977722lbc.10.1428434953717; Tue, 07 Apr 2015 12:29:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.39 with SMTP id kv7ls95624lac.63.gmail; Tue, 07 Apr 2015 12:29:13 -0700 (PDT) X-Received: by 10.153.4.5 with SMTP id ca5mr20113010lad.55.1428434953423; Tue, 07 Apr 2015 12:29:13 -0700 (PDT) Received: from mail-la0-x232.google.com (mail-la0-x232.google.com. [2a00:1450:4010:c03::232]) by mx.google.com with ESMTPS id py2si6871588lbb.33.2015.04.07.12.29.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 12:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::232 as permitted sender) client-ip=2a00:1450:4010:c03::232; Received: by laat2 with SMTP id t2so42978437laa.1 for ; Tue, 07 Apr 2015 12:29:13 -0700 (PDT) X-Received: by 10.152.23.70 with SMTP id k6mr19319606laf.76.1428434953123; Tue, 07 Apr 2015 12:29:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp618574lbt; Tue, 7 Apr 2015 12:29:11 -0700 (PDT) X-Received: by 10.68.227.195 with SMTP id sc3mr39481572pbc.64.1428434951506; Tue, 07 Apr 2015 12:29:11 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w7si12846045pdn.84.2015.04.07.12.29.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 12:29:11 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-394732-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 67143 invoked by alias); 7 Apr 2015 19:28:57 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 67131 invoked by uid 89); 7 Apr 2015 19:28:56 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f169.google.com Received: from mail-ob0-f169.google.com (HELO mail-ob0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 07 Apr 2015 19:28:55 +0000 Received: by oblw8 with SMTP id w8so55365357obl.0 for ; Tue, 07 Apr 2015 12:28:52 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.158.130 with SMTP id wu2mr26845272oeb.64.1428434932283; Tue, 07 Apr 2015 12:28:52 -0700 (PDT) Received: by 10.202.54.66 with HTTP; Tue, 7 Apr 2015 12:28:51 -0700 (PDT) In-Reply-To: <20150407155143.GK19273@tucnak.redhat.com> References: <5523F167.3010606@redhat.com> <20150407155143.GK19273@tucnak.redhat.com> Date: Tue, 7 Apr 2015 21:28:51 +0200 Message-ID: Subject: Re: patch to fix PR65648 From: Yvan Roux To: Jakub Jelinek Cc: Vladimir Makarov , Terry Guo , gcc-patches X-IsSubscribed: yes X-Original-Sender: yvan.roux@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::232 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 Hi Jakub, On 7 April 2015 at 17:51, Jakub Jelinek wrote: > On Tue, Apr 07, 2015 at 11:01:59AM -0400, Vladimir Makarov wrote: >> 2015-04-07 Vladimir Makarov >> >> PR target/65678 >> * lra-remat.c (do_remat): Process input and non-input insn >> registers separately. > > Don't have a quick access to arm box right now (without waiting for it to be > installed etc.), but using a cross-compiler I can at least reproduce > that your patch changes also: > > /* PR target/65648 */ > > int a = 0, *b = 0, c = 0; > static int d = 0; > short e = 1; > static long long f = 0; > long long *i = &f; > unsigned char j = 0; > > __attribute__((noinline, noclone)) void > foo (int x, int *y) > { > asm volatile ("" : : "r" (x), "r" (y) : "memory"); > } > > __attribute__((noinline, noclone)) void > bar (const char *x, long long y) > { > asm volatile ("" : : "r" (x), "r" (&y) : "memory"); > if (y != 0) > __builtin_abort (); > } > > int > main () > { > int k = 0; > b = &k; > j = (!a) - (c <= e); > *i = j; > foo (a, &k); > bar ("", f); > return 0; > } > > so, if anybody can confirm this testcase aborts with -march=armv6-m -mthumb -Os > before Vlad's patch and doesn't abort afterwards, perhaps just sticking > that into gcc.c-torture/execute/pr65648.c would be sufficient. > Or, if people don't regularly test with -march=armv6-m -mthumb combination, > perhaps put it into gcc.c-torture/execute/pr65648.c as is and > add another gcc.target/arm/pr65648.c testcase that will #include this one, > and use the right dg-options / dg-skip-if or dg-require-effective-target etc. > for it to trigger. As the testcase uses uninitialized r3 in the wrong case, > I wonder if the usual _start initializes r3 to some value that triggers the abort > without the fix; if not, perhaps it needs to be in another function and the caller > should somehow attempt to set l3 somehow (pass arguments to another function etc.) > to a value that will trigger the abort. validation is ongoing, but here is my attempt to add this testcase, does it look correct (it's the first time I use that kind of include in testsuite) Cheers, Yvan diff --git a/gcc/testsuite/gcc.c-torture/execute/pr65648.c b/gcc/testsuite/gcc.c-torture/execute/pr65648.c new file mode 100644 index 0000000..88a2fc9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr65648.c @@ -0,0 +1,34 @@ +/* PR target/65648 */ + +int a = 0, *b = 0, c = 0; +static int d = 0; +short e = 1; +static long long f = 0; +long long *i = &f; +unsigned char j = 0; + +__attribute__((noinline, noclone)) void +foo (int x, int *y) +{ + asm volatile ("" : : "r" (x), "r" (y) : "memory"); +} + +__attribute__((noinline, noclone)) void +bar (const char *x, long long y) +{ + asm volatile ("" : : "r" (x), "r" (&y) : "memory"); + if (y != 0) + __builtin_abort (); +} + +int +main () +{ + int k = 0; + b = &k; + j = (!a) - (c <= e); + *i = j; + foo (a, &k); + bar ("", f); + return 0; +} diff --git a/gcc/testsuite/gcc.target/arm/pr65648.c b/gcc/testsuite/gcc.target/arm/pr65648.c new file mode 100644 index 0000000..215c6a9 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr65648.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-options "-mthumb -Os" } */ +/* { dg-add-options arm_arch_v6m } */ + +#include "../../gcc.c-torture/execute/pr65648.c" +