[Patch, AVR, 4.6+trunk]: PR44643 addendum

Georg-Johann Lay avr@gjlay.de
Thu Jun 30 10:28:00 GMT 2011


avr_insert_attributes uses TREE_READONLY on get readonlyness of node.

That does not work for C++ arrays: it gives false error
"variable must be const in order to be put into read-only section by
means of '__attribute__((progmem))'".

This patch peels arrays and uses TYPE_READONLY.

I did not open separate PR for this, tagged it as addendum to PR44643
instead.

Lightly tested on own code. There is no 'progmem' in testsuite, so
from testsuite's perspective that code is dead, anyway...

Johann

	PR target/44643
	* config/avr/avr.c (avr_insert_attributes): Use TYPE_READONLY
	instead of TREE_READONLY.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr44643-peel.diff
Type: text/x-patch
Size: 779 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110630/fe5db6c3/attachment.bin>


More information about the Gcc-patches mailing list