https://github.com/python/cpython/commit/10d275fdf8bd55f438476ec5f08d55d2185b0042
commit: 10d275fdf8bd55f438476ec5f08d55d2185b0042
branch: main
author: Charlie Lin <[email protected]>
committer: Fidget-Spinner <[email protected]>
date: 2026-04-13T21:05:34+08:00
summary:

gh-148483: Use Py_GCC_ATTRIBUTE(unused) for stop_tracing label (GH-148481)

files:
A Misc/NEWS.d/next/Build/2026-04-13-02-36-13.gh-issue-148483.gLe1h8.rst
M .gitignore
M Modules/_testinternalcapi/test_cases.c.h
M Python/generated_cases.c.h
M Tools/cases_generator/tier1_generator.py

diff --git a/.gitignore b/.gitignore
index f9d2cdfc32b383..3bf5187d531c23 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
index 00000000000000..5b9b3069887580
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2026-04-13-02-36-13.gh-issue-148483.gLe1h8.rst
@@ -0,0 +1 @@
+Use ``Py_GCC_ATTRIBUTE(unused)`` for stop_tracing label.
diff --git a/Modules/_testinternalcapi/test_cases.c.h 
b/Modules/_testinternalcapi/test_cases.c.h
index 5ed7d7be41bf3f..041adcff388a41 100644
--- a/Modules/_testinternalcapi/test_cases.c.h
+++ b/Modules/_testinternalcapi/test_cases.c.h
@@ -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
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 6aa6fe445a2f88..ae01925077c29e 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -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
diff --git a/Tools/cases_generator/tier1_generator.py 
b/Tools/cases_generator/tier1_generator.py
index 0334bec724d305..d2fa749e1417f5 100644
--- a/Tools/cases_generator/tier1_generator.py
+++ b/Tools/cases_generator/tier1_generator.py
@@ -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:

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to