diff --git a/src/video_core/shader/ast.cpp b/src/video_core/shader/ast.cpp
index 14c50e1c68f7969aedbde8dd0abb048048a95fb0..74b9a8f9a93d7bc8121a9e3f111a9349abb77174 100644
--- a/src/video_core/shader/ast.cpp
+++ b/src/video_core/shader/ast.cpp
@@ -497,9 +497,7 @@ void ASTManager::Decompile() {
                 }
             }
             if (can_remove) {
-                auto& manager = label->GetManager();
-                manager.Remove(label);
-                labels.erase(it);
+                label->MarkLabelUnused();
             }
         }
     }
diff --git a/src/video_core/shader/ast.h b/src/video_core/shader/ast.h
index 849d0612c77de23b13eef4504d9594ab62347283..07deb58e4ddc1cf253c3d5a630cec140644b382a 100644
--- a/src/video_core/shader/ast.h
+++ b/src/video_core/shader/ast.h
@@ -112,6 +112,7 @@ class ASTLabel {
 public:
     ASTLabel(u32 index) : index{index} {}
     u32 index;
+    bool unused{};
 };
 
 class ASTGoto {
@@ -204,6 +205,13 @@ public:
         return nullptr;
     }
 
+    void MarkLabelUnused() const {
+        auto inner = std::get_if<ASTLabel>(&data);
+        if (inner) {
+            inner->unused = true;
+        }
+    }
+
     Expr GetIfCondition() const {
         auto inner = std::get_if<ASTIfThen>(&data);
         if (inner) {