re PR c++/79641 (ICE with const variable and attribute)

PR c++/79641
	* c-attribs.c (handle_mode_attribute): Use build_qualified_type to
	preserve quals.

	* c-c++-common/pr79641.c: New test.

From-SVN: r245632
This commit is contained in:
Jakub Jelinek 2017-02-21 17:55:00 +01:00 committed by Jakub Jelinek
parent d002d099b0
commit 00bc9de3fe
4 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2017-02-21 Jakub Jelinek <jakub@redhat.com>
PR c++/79641
* c-attribs.c (handle_mode_attribute): Use build_qualified_type to
preserve quals.
2017-02-17 Joseph Myers <joseph@codesourcery.com>
* c-cppbuiltin.c (builtin_define_float_constants): Define

View File

@ -1430,7 +1430,7 @@ handle_mode_attribute (tree *node, tree name, tree args,
return NULL_TREE;
}
*node = typefm;
*node = build_qualified_type (typefm, TYPE_QUALS (type));
}
return NULL_TREE;

View File

@ -1,5 +1,8 @@
2017-02-21 Jakub Jelinek <jakub@redhat.com>
PR c++/79641
* c-c++-common/pr79641.c: New test.
PR tree-optimization/79649
* gcc.target/i386/pr79649.c: New test.

View File

@ -0,0 +1,4 @@
/* PR c++/79641 */
/* { dg-do compile } */
const int __attribute__((__mode__ (__QI__))) i = 0;