re PR target/65210 ([avr] ICE: when using attributs 'address' and 'io_low')
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Fri, 4 Sep 2015 16:34:11 +0000 (16:34 +0000)
committerDenis Chertykov <denisc@gcc.gnu.org>
Fri, 4 Sep 2015 16:34:11 +0000 (19:34 +0300)
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
gcc/config/avr/avr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/avr/pr65210.c [new file with mode: 0644]

index bc2b86093969a539801ec8d39d219c278ce76451..75c59577815e98f675dbc34d9e0f0bac58181647 100644 (file)
@@ -1,3 +1,9 @@
+2015-09-02  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
+
+       PR target/65210
+       * config/avr/avr.c (avr_eval_addr_attrib): Look for io_low
+       attribute as well.
+
 2015-09-04  Tom de Vries  <tom@codesourcery.com>
 
        * doc/invoke.texi (@item -ftrapv, @item -fwrapv): Document interaction.
index bec9a8bb788e7646553134ff7b08a8617afa0025..9f5bc88ce308deff6647d3d80af58b94b58d31ec 100644 (file)
@@ -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))
index bb4f975e3633033b824fe24478babb5fcf824521..47b8700c5fdf1f631cdb34f835a65da409b3ce52 100644 (file)
@@ -1,3 +1,8 @@
+2015-09-02  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
+
+       PR target/65210
+       * gcc.target/avr/pr65210.c: New test.
+
 2015-09-04  H.J. Lu  <hongjiu.lu@intel.com>
 
        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 (file)
index 0000000..1aed441
--- /dev/null
@@ -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)));