From patchwork Wed Sep 2 07:51:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Senthil Kumar Selvaraj X-Patchwork-Id: 513338 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A3A8B1401E7 for ; Wed, 2 Sep 2015 17:52:14 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=oPtLkVfd; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=rocezPuk29ALewh7abi4hc6KnWzOc1+Ah/kp2RjD+/qUzyHdDl sFV+UucnPOvnALvGY4m061fgJsSpKs2t+qOmuVw1viBIEf7VvrWE+me0VbCt7LKu 6xNK4H/xfTMb+iexzjFG8kDcnnUJOWE2nOuFLAKL+fJVQ00faO6Z5OGqc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=QDSVWcafP5f+hHBwBJqQMDbYyNU=; b=oPtLkVfd6eC1JD6S605M 0L9+XuIsyGZKQpQYw8IBAmoVW0s9F9CqCimiVrGKlwCjgrDyQ1y1vhVPxBjD+RYe feHmOipSbc7+yTFvGkzzIIMazP4LGMDAwepEQIDiRIK64nQgkIdo7js7YaeVfiiu LiF9fBhWNgmpnQWcof/psYs= Received: (qmail 18655 invoked by alias); 2 Sep 2015 07:52:08 -0000 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 Received: (qmail 18646 invoked by uid 89); 2 Sep 2015 07:52:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL, BAYES_50, KAM_STOCKGEN, SPF_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: eusmtp01.atmel.com Received: from eusmtp01.atmel.com (HELO eusmtp01.atmel.com) (212.144.249.243) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 02 Sep 2015 07:52:05 +0000 Received: from apsmtp01.atmel.com (10.168.254.30) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.3.235.1; Wed, 2 Sep 2015 09:51:58 +0200 Received: from PENCHT01.corp.atmel.com (10.168.5.161) by apsmtp01.corp.atmel.com (10.168.254.30) with Microsoft SMTP Server (TLS) id 14.3.235.1; Wed, 2 Sep 2015 15:52:33 +0800 Received: from jaguar.corp.atmel.com (10.168.5.13) by cas-ap.atmel.com (10.168.5.161) with Microsoft SMTP Server (TLS) id 14.3.235.1; Wed, 2 Sep 2015 15:51:59 +0800 Date: Wed, 2 Sep 2015 13:21:54 +0530 From: Senthil Kumar Selvaraj To: CC: , Subject: [Patch, avr] Fix PR65210 Message-ID: <20150902075154.GB1047@jaguar.corp.atmel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23+102 (2ca89bed6448) (2014-03-12) X-IsSubscribed: yes 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)));