Fix PR90474

Message ID alpine.LSU.2.20.1905151213460.10704@zhemvz.fhfr.qr
State New
Headers show
Series
  • Fix PR90474
Related show

Commit Message

Richard Biener May 15, 2019, 10:16 a.m.
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  <rguenther@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.

Patch

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