+2020-01-29 Tobias Burnus <tobias@codesourcery.com>
+
+ PR middle-end/94233
+ * lto.c (offload_handle_link_vars): Cleanup; call
+ build_decl to ensure alignment is set.
+
2020-02-05 Martin Liska <mliska@suse.cz>
PR lto/93489
DECL_ATTRIBUTES (var->decl)))
{
tree type = build_pointer_type (TREE_TYPE (var->decl));
- tree link_ptr_var = make_node (VAR_DECL);
- TREE_TYPE (link_ptr_var) = type;
- TREE_USED (link_ptr_var) = 1;
- TREE_STATIC (link_ptr_var) = 1;
- SET_DECL_MODE (link_ptr_var, TYPE_MODE (type));
- DECL_SIZE (link_ptr_var) = TYPE_SIZE (type);
- DECL_SIZE_UNIT (link_ptr_var) = TYPE_SIZE_UNIT (type);
- DECL_ARTIFICIAL (link_ptr_var) = 1;
tree var_name = DECL_ASSEMBLER_NAME (var->decl);
char *new_name
= ACONCAT ((IDENTIFIER_POINTER (var_name), "_linkptr", NULL));
- DECL_NAME (link_ptr_var) = get_identifier (new_name);
+ tree link_ptr_var = build_decl (UNKNOWN_LOCATION, VAR_DECL,
+ get_identifier (new_name), type);
+ TREE_USED (link_ptr_var) = 1;
+ TREE_STATIC (link_ptr_var) = 1;
+ DECL_ARTIFICIAL (link_ptr_var) = 1;
SET_DECL_ASSEMBLER_NAME (link_ptr_var, DECL_NAME (link_ptr_var));
SET_DECL_VALUE_EXPR (var->decl, build_simple_mem_ref (link_ptr_var));
DECL_HAS_VALUE_EXPR_P (var->decl) = 1;