Skip to content

Commit d960076

Browse files
committed
Fix for removed variable when using LTO
1 parent 0115f12 commit d960076

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

gcc/jit/jit-playback.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,16 @@ global_new_decl (location *loc,
788788

789789
tree type_tree = type->as_tree ();
790790

791+
if (removed)
792+
{
793+
tree inner = build_decl (UNKNOWN_LOCATION, VAR_DECL,
794+
get_identifier (name),
795+
type_tree);
796+
// TODO: make it weak?
797+
DECL_EXTERNAL (inner) = 1;
798+
return inner;
799+
}
800+
791801
tree inner = build_decl (UNKNOWN_LOCATION, VAR_DECL,
792802
get_identifier (name),
793803
type_tree);

0 commit comments

Comments
 (0)