From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122241 invoked by alias); 24 Mar 2017 17:49:50 -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 122229 invoked by uid 89); 24 Mar 2017 17:49:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 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-wm0-f53.google.com Received: from mail-wm0-f53.google.com (HELO mail-wm0-f53.google.com) (74.125.82.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Mar 2017 17:49:48 +0000 Received: by mail-wm0-f53.google.com with SMTP id w204so8852102wmd.1 for ; Fri, 24 Mar 2017 10:49:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3I5MUorfAn7vSdtoksA7U83V/aBN4ZpyZKWSWapfDps=; b=mhZ6wUbaliATmyoUQY+ac5z8FNleJjPUiehifXEQkG+s4ObciAtflIG1ovKrkP9rCB OnZOYBzY5qCgC9VEvNU1jj6W3je/oibrChXplCpTy3xAiZ91ww/xpIEQ20k31F3Hb+Gh kEvqAHn6uw440LdeIvtotn3RKa4rW9TnySpVE3Yv/l34yRGyUE7WffZZ+LZhsXpChN/3 RsvQWE9KG3yrc0ve6f5Pfi976y0wgwu3XWdyYuQ+TnFFBbcp5/Hotl/CaarOuDb2/g7a owS4LadBztlHvYARK1L2X6Z8KVO9ryutq9jLgNd1xkQfI3ItN18kfYjPRU0ePQ29j+CD BQbw== X-Gm-Message-State: AFeK/H3H5LaH1evNi4lobY7BiVoUUNLX6zYkuGGEnO2u9k0yA/Sj1LPqECpZ/C2NdLdcWw== X-Received: by 10.28.212.79 with SMTP id l76mr4190305wmg.6.1490377787908; Fri, 24 Mar 2017 10:49:47 -0700 (PDT) Received: from localhost (host86-135-139-146.range86-135.btcentralplus.com. [86.135.139.146]) by smtp.gmail.com with ESMTPSA id i7sm3268256wmg.30.2017.03.24.10.49.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2017 10:49:46 -0700 (PDT) Date: Fri, 24 Mar 2017 17:50:00 -0000 From: Andrew Burgess To: Claudiu Zissulescu Cc: gcc-patches@gcc.gnu.org, Francois.Bedard@synopsys.com Subject: Re: [PATCH 1/5] [ARC] Save/restore blink when in ISR. Message-ID: <20170324174945.GI30605@embecosm.com> References: <1490010210-9489-1-git-send-email-claziss@synopsys.com> <1490010210-9489-2-git-send-email-claziss@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1490010210-9489-2-git-send-email-claziss@synopsys.com> X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.6.1 (2016-04-27) X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg01315.txt.bz2 * Claudiu Zissulescu [2017-03-20 12:43:26 +0100]: > BLIBK register needs to be saved/restored in a interrupt. Fix this issue. > > gcc/ > 2016-09-21 Claudiu Zissulescu > > * config/arc/arc.c (arc_epilogue_uses): BLINK should be also > restored when in interrupt. > * config/arc/arc.md (simple_return): ARCv2 rtie instruction > doesn't have delay slot. Looks good thanks, Andrew > > gcc/testsuite/ > 2016-09-21 Claudiu Zissulescu > > * gcc.target/arc/interrupt-4.c: New file. > --- > gcc/config/arc/arc.c | 10 ++++++---- > gcc/config/arc/arc.md | 7 ++++++- > gcc/testsuite/gcc.target/arc/interrupt-4.c | 15 +++++++++++++++ > 3 files changed, 27 insertions(+), 5 deletions(-) > create mode 100644 gcc/testsuite/gcc.target/arc/interrupt-4.c > > diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c > index 556b587..50bfa11 100644 > --- a/gcc/config/arc/arc.c > +++ b/gcc/config/arc/arc.c > @@ -9513,9 +9513,10 @@ arc_can_follow_jump (const rtx_insn *follower, const rtx_insn *followee) > Return true if REGNO should be added to the deemed uses of the epilogue. > > We use the return address > - arc_return_address_regs[arc_compute_function_type (cfun)] . > - But also, we have to make sure all the register restore instructions > - are known to be live in interrupt functions. */ > + arc_return_address_regs[arc_compute_function_type (cfun)]. But > + also, we have to make sure all the register restore instructions > + are known to be live in interrupt functions, plus the blink > + register if it is clobbered by the isr. */ > > bool > arc_epilogue_uses (int regno) > @@ -9528,7 +9529,8 @@ arc_epilogue_uses (int regno) > { > if (!fixed_regs[regno]) > return true; > - return regno == arc_return_address_regs[cfun->machine->fn_type]; > + return ((regno == arc_return_address_regs[cfun->machine->fn_type]) > + || (regno == RETURN_ADDR_REGNUM)); > } > else > return regno == RETURN_ADDR_REGNUM; > diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md > index a06c2ed..b912bd4 100644 > --- a/gcc/config/arc/arc.md > +++ b/gcc/config/arc/arc.md > @@ -4748,7 +4748,12 @@ > output_asm_insn (\"j%!%* [%0]%&\", ®); > return \"\"; > } > - [(set_attr "type" "return") > + [(set (attr "type") > + (cond [(and (eq (symbol_ref "arc_compute_function_type (cfun)") > + (symbol_ref "ARC_FUNCTION_ILINK1")) > + (match_test "TARGET_V2")) > + (const_string "brcc_no_delay_slot")] > + (const_string "return"))) > ; predicable won't help here since the canonical rtl looks different > ; for branches. > (set (attr "cond") > diff --git a/gcc/testsuite/gcc.target/arc/interrupt-4.c b/gcc/testsuite/gcc.target/arc/interrupt-4.c > new file mode 100644 > index 0000000..ea6596e > --- /dev/null > +++ b/gcc/testsuite/gcc.target/arc/interrupt-4.c > @@ -0,0 +1,15 @@ > +#if defined (__ARCHS__) || defined (__ARCEM__) > +#define RILINK "ilink" > +#else > +#define RILINK "ilink1" > +#endif > + > +extern int gpio_int; > +extern int read_reg (int); > + > +void __attribute__ ((interrupt(RILINK))) > +isr_handler (void) > +{ > + gpio_int = read_reg (1); > +} > +/* { dg-final { scan-assembler-times "blink" 2 } } */ > -- > 1.9.1 >