Skip to content

Commit c1a6652

Browse files
Partial GCC 15.0 support
1 parent 910bd88 commit c1a6652

File tree

7 files changed

+11117
-7161
lines changed

7 files changed

+11117
-7161
lines changed

Python/bytecodes.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ dummy_func(
10561056
if (err) {
10571057
assert(oparg == 0);
10581058
monitor_reraise(tstate, frame, this_instr);
1059-
CEVAL_GOTO(exception_unwind);
1059+
goto exception_unwind;
10601060
}
10611061
ERROR_IF(true, error);
10621062
}
@@ -1326,7 +1326,7 @@ dummy_func(
13261326
assert(exc && PyExceptionInstance_Check(exc));
13271327
_PyErr_SetRaisedException(tstate, exc);
13281328
monitor_reraise(tstate, frame, this_instr);
1329-
CEVAL_GOTO(exception_unwind);
1329+
goto exception_unwind;
13301330
}
13311331

13321332
tier1 inst(END_ASYNC_FOR, (awaitable_st, exc_st -- )) {
@@ -1342,7 +1342,7 @@ dummy_func(
13421342
_PyErr_SetRaisedException(tstate, exc);
13431343
monitor_reraise(tstate, frame, this_instr);
13441344
INPUTS_DEAD();
1345-
CEVAL_GOTO(exception_unwind);
1345+
goto exception_unwind;
13461346
}
13471347
}
13481348

@@ -1365,7 +1365,7 @@ dummy_func(
13651365
INPUTS_DEAD();
13661366
none = PyStackRef_NULL;
13671367
value = PyStackRef_NULL;
1368-
CEVAL_GOTO(exception_unwind);
1368+
goto exception_unwind;
13691369
}
13701370
}
13711371

@@ -4046,7 +4046,7 @@ dummy_func(
40464046
PyObject *res_o = PyLong_FromSsize_t(len_i);
40474047
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
40484048
if (res_o == NULL) {
4049-
CEVAL_GOTO(error);
4049+
goto error;
40504050
}
40514051
PyStackRef_CLOSE(arg_stackref);
40524052
DEAD(args);
@@ -4785,7 +4785,7 @@ dummy_func(
47854785
tstate, frame, this_instr, prev_instr);
47864786
if (original_opcode < 0) {
47874787
next_instr = this_instr+1;
4788-
CEVAL_GOTO(error);
4788+
goto error;
47894789
}
47904790
next_instr = frame->instr_ptr;
47914791
if (next_instr != this_instr) {

Python/ceval_macros.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,27 +79,26 @@
7979
#endif
8080

8181
#ifdef Py_TAIL_CALL_INTERP
82-
# define Py_MUSTTAIL __attribute__((musttail))
82+
// Note: [[clang::musttail]] works for GCC 15, but not __attribute__((musttail)) at the moment.
83+
# define Py_MUSTTAIL [[clang::musttail]]
8384
# define Py_PRESERVE_NONE_CC __attribute__((preserve_none))
8485
Py_PRESERVE_NONE_CC
8586
typedef PyObject* (*py_tail_call_funcptr)(TAIL_CALL_PARAMS);
8687
# define DISPATCH_GOTO() do { \
8788
Py_MUSTTAIL \
8889
return (INSTRUCTION_TABLE[opcode])(TAIL_CALL_ARGS); \
8990
} while (0)
90-
# define CEVAL_GOTO(name) do { \
91+
# define TAIL_CALL(name) do { \
9192
Py_MUSTTAIL \
9293
return (_TAIL_CALL_##name)(TAIL_CALL_ARGS); \
9394
} while (0)
9495

9596
#elif USE_COMPUTED_GOTOS
9697
# define TARGET(op) TARGET_##op:
9798
# define DISPATCH_GOTO() goto *opcode_targets[opcode]
98-
# define CEVAL_GOTO(name) goto name;
9999
#else
100100
# define TARGET(op) case op: TARGET_##op:
101101
# define DISPATCH_GOTO() goto dispatch_opcode
102-
# define CEVAL_GOTO(name) goto name;
103102
#endif
104103

105104
#define TAIL_CALL_TARGET(name) name
@@ -118,7 +117,7 @@
118117
do { \
119118
lltrace = maybe_lltrace_resume_frame(frame, GLOBALS()); \
120119
if (lltrace < 0) { \
121-
CEVAL_GOTO(exit_unwind); \
120+
goto exit_unwind; \
122121
} \
123122
} while (0)
124123
#else
@@ -158,13 +157,13 @@ do { \
158157
frame = tstate->current_frame = (NEW_FRAME); \
159158
CALL_STAT_INC(inlined_py_calls); \
160159
if (_Py_EnterRecursivePy(tstate)) {\
161-
CEVAL_GOTO(exit_unwind);\
160+
goto exit_unwind;\
162161
} \
163162
next_instr = frame->instr_ptr; \
164163
stack_pointer = _PyFrame_GetStackPointer(frame); \
165164
lltrace = maybe_lltrace_resume_frame(frame, GLOBALS()); \
166165
if (lltrace < 0) { \
167-
CEVAL_GOTO(exit_unwind); \
166+
goto exit_unwind; \
168167
} \
169168
NEXTOPARG(); \
170169
DISPATCH_GOTO(); \
@@ -178,7 +177,7 @@ do { \
178177
frame = tstate->current_frame = (NEW_FRAME); \
179178
CALL_STAT_INC(inlined_py_calls); \
180179
if (_Py_EnterRecursivePy(tstate)) { \
181-
CEVAL_GOTO(exit_unwind); \
180+
goto exit_unwind; \
182181
} \
183182
next_instr = frame->instr_ptr; \
184183
stack_pointer = _PyFrame_GetStackPointer(frame); \
@@ -447,7 +446,7 @@ do { \
447446
stack_pointer = _PyFrame_GetStackPointer(frame); \
448447
if (next_instr == NULL) { \
449448
next_instr = (dest)+1; \
450-
CEVAL_GOTO(error); \
449+
goto error; \
451450
} \
452451
} \
453452
} while (0);
@@ -491,7 +490,7 @@ do { \
491490
tstate->previous_executor = NULL; \
492491
frame = tstate->current_frame; \
493492
if (next_instr == NULL) { \
494-
CEVAL_GOTO(resume_with_error); \
493+
goto resume_with_error; \
495494
} \
496495
stack_pointer = _PyFrame_GetStackPointer(frame); \
497496
DISPATCH(); \

Python/executor_cases.c.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)