Skip to content

Commit 6ad6c52

Browse files
committed
Fix for removed variable when using LTO
1 parent d61ce94 commit 6ad6c52

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

gcc/jit/jit-playback.cc

+10
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,16 @@ global_new_decl (location *loc,
784784

785785
tree type_tree = type->as_tree ();
786786

787+
if (removed)
788+
{
789+
tree inner = build_decl (UNKNOWN_LOCATION, VAR_DECL,
790+
get_identifier (name),
791+
type_tree);
792+
// TODO: make it weak?
793+
DECL_EXTERNAL (inner) = 1;
794+
return inner;
795+
}
796+
787797
tree inner = build_decl (UNKNOWN_LOCATION, VAR_DECL,
788798
get_identifier (name),
789799
type_tree);

0 commit comments

Comments
 (0)