From b52ec220503a1c7fa25b21b8c34c4428b3ec13f8 Mon Sep 17 00:00:00 2001 From: Senthil Kumar Selvaraj Date: Fri, 4 Sep 2015 16:34:11 +0000 Subject: [PATCH] re PR target/65210 ([avr] ICE: when using attributs 'address' and 'io_low') gcc/ChangeLog 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. From-SVN: r227496 --- gcc/ChangeLog | 6 ++++++ gcc/config/avr/avr.c | 2 ++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/avr/pr65210.c | 7 +++++++ 4 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/gcc.target/avr/pr65210.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc2b8609396..75c59577815 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-09-02 Senthil Kumar Selvaraj + + PR target/65210 + * config/avr/avr.c (avr_eval_addr_attrib): Look for io_low + attribute as well. + 2015-09-04 Tom de Vries * doc/invoke.texi (@item -ftrapv, @item -fwrapv): Document interaction. diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index bec9a8bb788..9f5bc88ce30 100644 --- a/gcc/config/avr/avr.c +++ b/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 a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bb4f975e363..47b8700c5fd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-09-02 Senthil Kumar Selvaraj + + PR target/65210 + * gcc.target/avr/pr65210.c: New test. + 2015-09-04 H.J. Lu PR testsuite/67450 diff --git a/gcc/testsuite/gcc.target/avr/pr65210.c b/gcc/testsuite/gcc.target/avr/pr65210.c new file mode 100644 index 00000000000..1aed4417c1f --- /dev/null +++ b/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))); -- 2.30.2