]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-148483: Use Py_GCC_ATTRIBUTE(unused) for stop_tracing label (GH-148481)
authorCharlie Lin <tuug@gmx.us>
Mon, 13 Apr 2026 13:05:34 +0000 (09:05 -0400)
committerGitHub <noreply@github.com>
Mon, 13 Apr 2026 13:05:34 +0000 (21:05 +0800)
.gitignore
Misc/NEWS.d/next/Build/2026-04-13-02-36-13.gh-issue-148483.gLe1h8.rst [new file with mode: 0644]
Modules/_testinternalcapi/test_cases.c.h
Python/generated_cases.c.h
Tools/cases_generator/tier1_generator.py

index f9d2cdfc32b3835fc71c0c79c25a37967ab40b2a..3bf5187d531c2392ab1f6b64b521eda969048d22 100644 (file)
@@ -5,6 +5,7 @@
 *.cover
 *.iml
 *.o
+*.o.tmp
 *.lto
 *.a
 *.so
diff --git a/Misc/NEWS.d/next/Build/2026-04-13-02-36-13.gh-issue-148483.gLe1h8.rst b/Misc/NEWS.d/next/Build/2026-04-13-02-36-13.gh-issue-148483.gLe1h8.rst
new file mode 100644 (file)
index 0000000..5b9b306
--- /dev/null
@@ -0,0 +1 @@
+Use ``Py_GCC_ATTRIBUTE(unused)`` for stop_tracing label.
index 5ed7d7be41bf3fd623ab3f68151a10db72fd6e97..041adcff388a41ed8a69a7b7e8f0ea04a30edf85 100644 (file)
@@ -12943,6 +12943,9 @@ JUMP_TO_LABEL(error);
             DISPATCH();
         }
 
+        #if _Py_TAIL_CALL_INTERP && !defined(_Py_TIER2)
+        Py_GCC_ATTRIBUTE((unused))
+        #endif
         LABEL(stop_tracing)
         {
             #if _Py_TIER2
index 6aa6fe445a2f882123d394fcad8ccf724cb6e02b..ae01925077c29eeef484a5cf5ff1f2acb23c1bc2 100644 (file)
@@ -12940,6 +12940,9 @@ JUMP_TO_LABEL(error);
             DISPATCH();
         }
 
+        #if _Py_TAIL_CALL_INTERP && !defined(_Py_TIER2)
+        Py_GCC_ATTRIBUTE((unused))
+        #endif
         LABEL(stop_tracing)
         {
             #if _Py_TIER2
index 0334bec724d305876f408f532ebe55bbacbc8aeb..d2fa749e1417f51a3a3d75c54e7ad4433d2ca92e 100644 (file)
@@ -203,6 +203,10 @@ def generate_tier1_labels(
     emitter.emit("\n")
     # Emit tail-callable labels as function defintions
     for name, label in analysis.labels.items():
+        if name == 'stop_tracing':
+            emitter.emit("#if _Py_TAIL_CALL_INTERP && !defined(_Py_TIER2)\n")
+            emitter.emit("Py_GCC_ATTRIBUTE((unused))\n")
+            emitter.emit("#endif\n")
         emitter.emit(f"LABEL({name})\n")
         storage = Storage(Stack(), [], [], 0, False)
         if label.spilled: