From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30338 invoked by alias); 4 Sep 2015 16:35:01 -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 30327 invoked by uid 89); 4 Sep 2015 16:35:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-lb0-f172.google.com Received: from mail-lb0-f172.google.com (HELO mail-lb0-f172.google.com) (209.85.217.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 04 Sep 2015 16:35:00 +0000 Received: by lbpo4 with SMTP id o4so14355912lbp.2 for ; Fri, 04 Sep 2015 09:34:56 -0700 (PDT) X-Received: by 10.152.5.169 with SMTP id t9mr4532619lat.55.1441384496897; Fri, 04 Sep 2015 09:34:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.185.168 with HTTP; Fri, 4 Sep 2015 09:34:37 -0700 (PDT) In-Reply-To: <20150902075154.GB1047@jaguar.corp.atmel.com> References: <20150902075154.GB1047@jaguar.corp.atmel.com> From: Denis Chertykov Date: Fri, 04 Sep 2015 17:37:00 -0000 Message-ID: Subject: Re: [Patch, avr] Fix PR65210 To: Senthil Kumar Selvaraj Cc: gcc-patches , Georg Johann Lay Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-09/txt/msg00364.txt.bz2 Committed. 2015-09-02 10:51 GMT+03:00 Senthil Kumar Selvaraj : > Hi, > > This (rather trivial) patch fixes PR65210. The ICE happens because code > wasn't handling io_low attribute where it is supposed to. > > If this is ok, could someone commit please? I don't have commit > access. > > Regards > Senthil > > gcc/ChangeLog > > 2015-09-02 Senthil Kumar Selvaraj > > PR target/65210 > * config/avr/avr.c (avr_eval_addr_attrib): Look for io_low > attribute as well. > > gcc/testsuite/ChangeLog > > PR target/65210 > * gcc.target/avr/pr65210.c: New test. > > diff --git gcc/config/avr/avr.c gcc/config/avr/avr.c > index bec9a8b..9f5bc88 100644 > --- gcc/config/avr/avr.c > +++ gcc/config/avr/avr.c > @@ -9069,6 +9069,8 @@ avr_eval_addr_attrib (rtx x) > if (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_IO) > { > attr = lookup_attribute ("io", DECL_ATTRIBUTES (decl)); > + if (!attr || !TREE_VALUE (attr)) > + attr = lookup_attribute ("io_low", DECL_ATTRIBUTES (decl)); > gcc_assert (attr); > } > if (!attr || !TREE_VALUE (attr)) > diff --git gcc/testsuite/gcc.target/avr/pr65210.c gcc/testsuite/gcc.target/avr/pr65210.c > new file mode 100644 > index 0000000..1aed441 > --- /dev/null > +++ gcc/testsuite/gcc.target/avr/pr65210.c > @@ -0,0 +1,7 @@ > +/* { dg-do compile } */ > + > +/* This testcase exposes PR65210. Usage of the io_low attribute > + causes assertion failure because code only looks for the io > + attribute if SYMBOL_FLAG_IO is set. */ > + > +volatile char q __attribute__((io_low,address(0x81)));