[Patch, avr] Fix PR65210

Senthil Kumar Selvaraj senthil_kumar.selvaraj@atmel.com
Wed Sep 2 07:52:00 GMT 2015


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  <senthil_kumar.selvaraj@atmel.com>

	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)));



More information about the Gcc-patches mailing list