All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 08/13] expression: recognize references to labels as address constants
@ 2015-07-22 23:20 Nicolai Stange
  0 siblings, 0 replies; only message in thread
From: Nicolai Stange @ 2015-07-22 23:20 UTC (permalink / raw)
  To: linux-sparse

As an extension, GCC allows labels to be referenced a la
  label1:
  ...

  void *ptr = &&label1;

Tag these label references as being address constants allowing them
to be used as initializers for objects of static storage duration.

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---
 expression.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/expression.c b/expression.c
index 4d5edc8..19786e8 100644
--- a/expression.c
+++ b/expression.c
@@ -684,6 +684,8 @@ static struct token *unary_expression(struct token *token, struct expression **t
 				sym->ctype.modifiers |= MOD_ADDRESSABLE;
 				add_symbol(&function_computed_target_list, sym);
 			}
+			label->flags |=
+				expr_set_flag_mask(EXPR_FLAG_ADDR_CONST_EXPR);
 			label->label_symbol = sym;
 			*tree = label;
 			return token->next->next;
-- 
2.4.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-22 23:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22 23:20 [PATCH RFC 08/13] expression: recognize references to labels as address constants Nicolai Stange

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.