2016-10-21 Jakub Jelinek <jakub@redhat.com>
+ * dwarf2out.c (gen_variable_die): Emit DW_AT_const_expr attribute
+ if needed. Re-add origin_die variable and its initialization.
+
* gimplify.c (gimplify_bind_expr): Handle oacc_declare_returns
even for -fstack-reuse=none, or for volatile vars etc.
+2016-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
+ DW_AT_const_expr.
+
2016-10-17 Jakub Jelinek <jakub@redhat.com>
* cp-objcp-common.h (cp_function_decl_explicit_p,
tree ultimate_origin;
dw_die_ref var_die;
dw_die_ref old_die = decl ? lookup_decl_die (decl) : NULL;
+ dw_die_ref origin_die = NULL;
bool declaration = (DECL_EXTERNAL (decl_or_origin)
|| class_or_namespace_scope_p (context_die));
bool specialization_p = false;
var_die = new_die (DW_TAG_variable, context_die, decl);
if (origin != NULL)
- add_abstract_origin_attribute (var_die, origin);
+ origin_die = add_abstract_origin_attribute (var_die, origin);
/* Loop unrolling can create multiple blocks that refer to the same
static variable, so we must test for the DW_AT_declaration flag.
}
else
tree_add_const_value_attribute_for_decl (var_die, decl_or_origin);
+
+ if ((dwarf_version >= 4 || !dwarf_strict)
+ && lang_hooks.decls.decl_dwarf_attribute (decl_or_origin,
+ DW_AT_const_expr) == 1
+ && !get_AT (var_die, DW_AT_const_expr)
+ && (origin_die == NULL || get_AT (origin_die, DW_AT_const_expr) == NULL)
+ && !specialization_p)
+ add_AT_flag (var_die, DW_AT_const_expr, 1);
}
/* Generate a DIE to represent a named constant. */