From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4206 invoked by alias); 23 Jun 2017 11:15: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 4045 invoked by uid 89); 23 Jun 2017 11:15:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-ua0-f169.google.com Received: from mail-ua0-f169.google.com (HELO mail-ua0-f169.google.com) (209.85.217.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Jun 2017 11:15:18 +0000 Received: by mail-ua0-f169.google.com with SMTP id z22so34735943uah.1 for ; Fri, 23 Jun 2017 04:15:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/MafThtRDShMd6GLbAaRbXk3o81tIKOnKDmFGvArea0=; b=su5K0c/Rb4Pge5m3YWPs6hK2cumJ9qYcBmONGGi/kX5VzMAtmdnWP7EzTetOcP0p28 DUW9hvcP/RctmcLHjNz39kAWa+BAvtMvSk1nh0HjOvHMG4JIs6ddyaEsEDae2+9SyWTS yTN8Jy6MtrkTV+BhSjU0RiSJtKIsbVNxO/3NYlYQRwxLAdjkLlng1ZkmrphvWMfvQGMi E3VIlLCp/MViyfF3VuUGIfKGul9cEqMyke49dmUiJdks6uJucn720gz4+M8cSVmDeOlO LKl89CXoG2d8yYyDYT2O0U6K0JmMZ6VNGMVwd9svKL0BNnmhvB1B7AI8I5TYJwVmxi6d 11jQ== X-Gm-Message-State: AKS2vOxSyHl1kcJCqkqKDzVjX9X21Y45eGomWPKbFoasoYof0eehRCIh fOp0T5BWDGI66itWtuofEQgvOxDoyVTm X-Received: by 10.159.49.84 with SMTP id n20mr5519936uab.117.1498216512992; Fri, 23 Jun 2017 04:15:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.148.220 with HTTP; Fri, 23 Jun 2017 04:15:12 -0700 (PDT) In-Reply-To: References: From: Christophe Lyon Date: Fri, 23 Jun 2017 11:15:00 -0000 Message-ID: Subject: Re: [committed] Fix -fstack-check with really big frames on aarch64 To: Jeff Law Cc: gcc-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01771.txt.bz2 On 22 June 2017 at 19:21, Jeff Law wrote: > > This time with the test. Just #includes 20031023-1.c with a suitable dg > directive to ensure we compile with -fstack-check. > > I won't be surprised if other targets fail this test. It's a really big > stack frame :-) > > Anyways, committed to the trunk. > > > > Jeff > > diff --git a/gcc/ChangeLog b/gcc/ChangeLog > index 0a3426eef3e..03a824f6b3f 100644 > --- a/gcc/ChangeLog > +++ b/gcc/ChangeLog > @@ -1,3 +1,8 @@ > +2017-06-22 Jeff Law > + > + * config/aarch64/aarch64.c (aarch64_emit_probe_stack_range): Handle > + frame sizes that do not satisfy aarch64_uimm12_shift. > + > 2017-06-22 Jan Hubicka > > * profile-count.h (apply_probability, > diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c > index 3364a02e89c..95592f9fa17 100644 > --- a/gcc/config/aarch64/aarch64.c > +++ b/gcc/config/aarch64/aarch64.c > @@ -2766,11 +2766,19 @@ aarch64_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size) > plus_constant (Pmode, stack_pointer_rtx, -first)); > > /* LAST_ADDR = SP + FIRST + ROUNDED_SIZE. */ > - emit_set_insn (reg2, > - plus_constant (Pmode, stack_pointer_rtx, > - -(first + rounded_size))); > - > - > + HOST_WIDE_INT adjustment = - (first + rounded_size); > + if (! aarch64_uimm12_shift (adjustment)) > + { > + aarch64_internal_mov_immediate (reg2, GEN_INT (adjustment), > + true, Pmode); > + emit_set_insn (reg2, gen_rtx_PLUS (Pmode, stack_pointer_rtx, reg2)); > + } > + else > + { > + emit_set_insn (reg2, > + plus_constant (Pmode, stack_pointer_rtx, adjustment)); > + } > + > /* Step 3: the loop > > do > diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog > index 641e4124e37..e162386fb68 100644 > --- a/gcc/testsuite/ChangeLog > +++ b/gcc/testsuite/ChangeLog > @@ -1,3 +1,7 @@ > +2017-06-22 Jeff Law > + > + * gcc.c-torture/compile/stack-check-1.c: New test. > + > 2016-06-22 Richard Biener > > * gcc.dg/vect/pr65947-1.c: Remove xfail. > diff --git a/gcc/testsuite/gcc.c-torture/compile/stack-check-1.c b/gcc/testsuite/gcc.c-torture/compile/stack-check-1.c > new file mode 100644 > index 00000000000..4058eb58709 > --- /dev/null > +++ b/gcc/testsuite/gcc.c-torture/compile/stack-check-1.c > @@ -0,0 +1,2 @@ > +/* { dg-additional-options "-fstack-check" } */ > +#include "20031023-1.c" > Hi, A minor comment at this stage: this new test fails to compile for thumb-1 targets: testsuite/gcc.c-torture/compile/20031023-1.c:27:1: sorry, unimplemented: -fstack-check=specific for Thumb-1 for instance on arm-none-linux-gnueabi --with-mode=thumb --with-cpu=cortex-a9 and forcing -march=armv5t in runtest flags. Is there a clean way to make it unsupported? Thanks, Christophe