From patchwork Thu Jan 3 12:45:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Clifton X-Patchwork-Id: 209242 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]) by ozlabs.org (Postfix) with SMTP id A10A52C007A for ; Thu, 3 Jan 2013 23:49:07 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1357822147; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=WORhhEVf9SbSgM58RFTv 9nYPksU=; b=vIvLcE0qIfprFaUQaRTHhkcYSImsD9ZnJj6xocHQbBytZ8rtKvic sr9AVQMONc2yJaDJyB0hDehaDXcRE809QKl6PURqiXvz96B7/TGNbjWXb0QANa5x 92MUJCbyLcTO8KKNMNv7IEmDUaCUUhKyzAy7ZY6w3G8aYyRzdLO1Mns= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=TEXEKLjtR8/gKO2DuDA06ijvqF2/j1s0cRe7UGD77tH5KbbbpkSuzvHE3P1QyS XMe5WMEUNYJxn5/4mEUpkG7FuQBvqIYrvn7wF9Yd729PJT9B7pYEmiNJK/LcEoVl GCPkCrWiZbW5PxY2WKgEQ8BfEx5wla9+Sxg9S4DNUJ0ZI=; Received: (qmail 12823 invoked by alias); 3 Jan 2013 12:49:01 -0000 Received: (qmail 12808 invoked by uid 22791); 3 Jan 2013 12:48:59 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Jan 2013 12:48:53 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r03CmqUI005780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 3 Jan 2013 07:48:53 -0500 Received: from Cadeux.redhat.com (vpn1-4-29.ams2.redhat.com [10.36.4.29]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r03CmdSJ032679 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 3 Jan 2013 07:48:48 -0500 From: Nick Clifton To: dj@redhat.com Cc: gcc-patches@gcc.gnu.org Subject: RFA: RL78: Always select register bank 0 at the start of an ISR Date: Thu, 03 Jan 2013 12:45:15 +0000 Message-ID: <878v8a1llw.fsf@redhat.com> MIME-Version: 1.0 X-IsSubscribed: yes 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 Hi DJ, Since interrupts can happen at any time, it is possible for a ISR to be called when register bank 0 is not the currently selected bank. Hence the prologue for an interrupt handler should always select bank 0 before saving any registers. The patch below makes sure that this happens. No regressions with a rl78-elf toolchain. OK to apply ? Cheers Nick gcc/ChangeLog 2013-01-03 Nick Clifton * config/rl78/rl78.c (rl78_expand_prologue): Always select register bank 0 at the start of an interrupt handler. Index: gcc/config/rl78/rl78.c =================================================================== --- gcc/config/rl78/rl78.c (revision 194833) +++ gcc/config/rl78/rl78.c (working copy) @@ -839,6 +839,9 @@ if (flag_stack_usage_info) current_function_static_stack_size = cfun->machine->framesize; + if (is_interrupt_func (cfun->decl)) + emit_insn (gen_sel_rb (GEN_INT (0))); + for (i = 0; i < 16; i++) if (cfun->machine->need_to_push [i]) {