@@ -776,7 +776,8 @@ global_new_decl (location *loc,
776776 enum global_var_flags flags,
777777 const std::vector<std::pair<gcc_jit_variable_attribute,
778778 std::string>> &attributes,
779- bool readonly)
779+ bool readonly,
780+ bool removed)
780781{
781782 gcc_assert (type);
782783 gcc_assert (name);
@@ -788,6 +789,8 @@ global_new_decl (location *loc,
788789 type_tree);
789790
790791 TREE_PUBLIC (inner) = (kind != GCC_JIT_GLOBAL_INTERNAL );
792+ if (removed)
793+ TREE_ASM_WRITTEN (inner) = 1 ;
791794
792795
793796 int will_be_init = flags & (GLOBAL_VAR_FLAGS_WILL_BE_RVAL_INIT |
@@ -869,10 +872,11 @@ new_global (location *loc,
869872 enum global_var_flags flags,
870873 const std::vector<std::pair<gcc_jit_variable_attribute,
871874 std::string>> &attributes,
872- bool readonly)
875+ bool readonly,
876+ bool removed)
873877{
874878 tree inner =
875- global_new_decl (loc, kind, type, name, flags, attributes, readonly);
879+ global_new_decl (loc, kind, type, name, flags, attributes, readonly, removed );
876880
877881 return global_finalize_lvalue (inner);
878882}
@@ -1020,9 +1024,10 @@ new_global_initialized (location *loc,
10201024 enum global_var_flags flags,
10211025 const std::vector<std::pair<gcc_jit_variable_attribute,
10221026 std::string>> &attributes,
1023- bool readonly)
1027+ bool readonly,
1028+ bool removed)
10241029{
1025- tree inner = global_new_decl (loc, kind, type, name, flags, attributes, readonly);
1030+ tree inner = global_new_decl (loc, kind, type, name, flags, attributes, readonly, removed );
10261031
10271032 vec<constructor_elt, va_gc> *constructor_elements = NULL ;
10281033
0 commit comments