The following fixes PR90474 which shows the (relatively) new
c_common_mark_addressable_vec failed to inherit setting
TREE_ADDRESSABLE on a COMPOUND_LITERAL_EXPR_DECL from
c_mark_addressable.

Bootstrap / regtest running on x86_64-unknown-linux-gnu, will
commit as obvious to all branches if that succeeds.

Richard.

2019-05-15  Richard Biener  <rguent...@suse.de>

        PR c/90474
        * c-common.c (c_common_mark_addressable_vec): Also mark
        a COMPOUND_LITERAL_EXPR_DECL addressable similar to
        c_mark_addressable.

Index: gcc/c-family/c-common.c
===================================================================
--- gcc/c-family/c-common.c     (revision 271203)
+++ gcc/c-family/c-common.c     (working copy)
@@ -6554,6 +6554,8 @@ c_common_mark_addressable_vec (tree t)
     return;
   if (!VAR_P (t) || !DECL_HARD_REGISTER (t))
     TREE_ADDRESSABLE (t) = 1;
+  if (TREE_CODE (t) == COMPOUND_LITERAL_EXPR)
+    TREE_ADDRESSABLE (COMPOUND_LITERAL_EXPR_DECL (t)) = 1;
 }
 
 

Reply via email to