From: Charlie Lin Date: Mon, 13 Apr 2026 13:05:34 +0000 (-0400) Subject: gh-148483: Use Py_GCC_ATTRIBUTE(unused) for stop_tracing label (GH-148481) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=10d275fdf8bd55f438476ec5f08d55d2185b0042;p=thirdparty%2FPython%2Fcpython.git gh-148483: Use Py_GCC_ATTRIBUTE(unused) for stop_tracing label (GH-148481) --- diff --git a/.gitignore b/.gitignore index f9d2cdfc32b3..3bf5187d531c 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 000000000000..5b9b30698875 --- /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 5ed7d7be41bf..041adcff388a 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 6aa6fe445a2f..ae01925077c2 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 0334bec724d3..d2fa749e1417 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: