Skip to content

gh-137136: Suppress build warnings when build on Windows with --experimental-jit-interpreter #137137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Include/internal/pycore_optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ extern bool _Py_uop_sym_is_bottom(JitOptRef sym);
extern int _Py_uop_sym_truthiness(JitOptContext *ctx, JitOptRef sym);
extern PyTypeObject *_Py_uop_sym_get_type(JitOptRef sym);
extern JitOptRef _Py_uop_sym_new_tuple(JitOptContext *ctx, int size, JitOptRef *args);
extern JitOptRef _Py_uop_sym_tuple_getitem(JitOptContext *ctx, JitOptRef sym, int item);
extern int _Py_uop_sym_tuple_length(JitOptRef sym);
extern JitOptRef _Py_uop_sym_tuple_getitem(JitOptContext *ctx, JitOptRef sym, Py_ssize_t item);
extern Py_ssize_t _Py_uop_sym_tuple_length(JitOptRef sym);
extern JitOptRef _Py_uop_sym_new_truthiness(JitOptContext *ctx, JitOptRef value, bool truthy);
extern bool _Py_uop_sym_is_compact_int(JitOptRef sym);
extern JitOptRef _Py_uop_sym_new_compact_int(JitOptContext *ctx);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Suppress build warnings when build on Windows with
``--experimental-jit-interpreter``.
5 changes: 3 additions & 2 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ dummy_func(
assert(next_instr->op.code == STORE_FAST);
next_oparg = next_instr->op.arg;
#else
next_oparg = CURRENT_OPERAND0();
next_oparg = (int)CURRENT_OPERAND0();
#endif
_PyStackRef *target_local = &GETLOCAL(next_oparg);
assert(PyUnicode_CheckExact(left_o));
Expand Down Expand Up @@ -5246,7 +5246,8 @@ dummy_func(
printf("SIDE EXIT: [UOp ");
_PyUOpPrint(&next_uop[-1]);
printf(", exit %lu, temp %d, target %d -> %s]\n",
exit - current_executor->exits, exit->temperature.value_and_backoff,
(unsigned long)(exit - current_executor->exits),
exit->temperature.value_and_backoff,
(int)(target - _PyFrame_GetBytecode(frame)),
_PyOpcode_OpName[target->op.code]);
}
Expand Down
5 changes: 3 additions & 2 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Python/optimizer_analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
opcode = buffer[pc].opcode = op_without_pop[opcode];
if (op_without_pop[last->opcode]) {
opcode = last->opcode;
pc = last - buffer;
pc = (int)(last - buffer);
}
}
else if (last->opcode == _PUSH_NULL) {
Expand Down
10 changes: 5 additions & 5 deletions Python/optimizer_bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ dummy_func(void) {
assert(PyLong_CheckExact(sym_get_const(ctx, sub_st)));
long index = PyLong_AsLong(sym_get_const(ctx, sub_st));
assert(index >= 0);
int tuple_length = sym_tuple_length(tuple_st);
Py_ssize_t tuple_length = sym_tuple_length(tuple_st);
if (tuple_length == -1) {
// Unknown length
res = sym_new_not_null(ctx);
Expand Down Expand Up @@ -1166,9 +1166,9 @@ dummy_func(void) {

op(_CALL_LEN, (callable, null, arg -- res)) {
res = sym_new_type(ctx, &PyLong_Type);
int tuple_length = sym_tuple_length(arg);
Py_ssize_t tuple_length = sym_tuple_length(arg);
if (tuple_length >= 0) {
PyObject *temp = PyLong_FromLong(tuple_length);
PyObject *temp = PyLong_FromSsize_t(tuple_length);
if (temp == NULL) {
goto error;
}
Expand All @@ -1182,13 +1182,13 @@ dummy_func(void) {
}

op(_GET_LEN, (obj -- obj, len)) {
int tuple_length = sym_tuple_length(obj);
Py_ssize_t tuple_length = sym_tuple_length(obj);
if (tuple_length == -1) {
len = sym_new_type(ctx, &PyLong_Type);
}
else {
assert(tuple_length >= 0);
PyObject *temp = PyLong_FromLong(tuple_length);
PyObject *temp = PyLong_FromSsize_t(tuple_length);
if (temp == NULL) {
goto error;
}
Expand Down
10 changes: 5 additions & 5 deletions Python/optimizer_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Python/optimizer_symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ _Py_uop_sym_new_tuple(JitOptContext *ctx, int size, JitOptRef *args)
}

JitOptRef
_Py_uop_sym_tuple_getitem(JitOptContext *ctx, JitOptRef ref, int item)
_Py_uop_sym_tuple_getitem(JitOptContext *ctx, JitOptRef ref, Py_ssize_t item)
{
JitOptSymbol *sym = PyJitRef_Unwrap(ref);
assert(item >= 0);
Expand All @@ -683,7 +683,7 @@ _Py_uop_sym_tuple_getitem(JitOptContext *ctx, JitOptRef ref, int item)
return _Py_uop_sym_new_not_null(ctx);
}

int
Py_ssize_t
_Py_uop_sym_tuple_length(JitOptRef ref)
{
JitOptSymbol *sym = PyJitRef_Unwrap(ref);
Expand Down
Loading