+2017-09-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/82340
+ * c-decl.c (build_compound_literal): Use c_apply_type_quals_to_decl
+ instead of trying to set just TREE_READONLY manually.
+
2017-09-16 Tom de Vries <tom@codesourcery.com>
PR c/81875
DECL_ARTIFICIAL (decl) = 1;
DECL_IGNORED_P (decl) = 1;
TREE_TYPE (decl) = type;
- TREE_READONLY (decl) = (TYPE_READONLY (type)
- || (TREE_CODE (type) == ARRAY_TYPE
- && TYPE_READONLY (TREE_TYPE (type))));
+ c_apply_type_quals_to_decl (TYPE_QUALS (strip_array_types (type)), decl);
store_init_value (loc, decl, init, NULL_TREE);
if (TREE_CODE (type) == ARRAY_TYPE && !COMPLETE_TYPE_P (type))
2017-09-29 Jakub Jelinek <jakub@redhat.com>
+ PR c/82340
+ * gcc.dg/tree-ssa/pr82340.c: New test.
+
* g++.dg/eh/uncaught3.C: Add -Wno-deprecated for c++17.
2017-09-28 Paolo Carlini <paolo.carlini@oracle.com>
--- /dev/null
+/* PR c/82340 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ssa" } */
+/* { dg-final { scan-tree-dump "D.\[0-9]*\\\[0\\\] ={v} 77;" "ssa" } } */
+
+int
+foo (void)
+{
+ int i;
+ volatile char *p = (volatile char[1]) { 77 };
+ for (i = 1; i < 10; i++)
+ *p = 4;
+ return *p;
+}