Compilation "neighbors/_kd_tree.pyx" crashes on ARM

### Describe the bug

Hi. I rebuilt scikit-learn from source, but the compiler crashed.

### Steps/Code to Reproduce

```shell
$ cat /etc/debian_version

12.11
```

```shell
$ cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
```

```shell
$ gcc --version

gcc (Debian 12.2.0-14+deb12u1) 12.2.0
```

```shell
$ cat requirements | grep scikit
scikit-learn==1.5.2 ; python_version >= "3.12" and python_version < "3.13"

$ pip3 install -r requirements.txt --no-deps --no-binary ":all:" -vvv
```



### Expected Results

Build without problmes

### Actual Results

```
[205/249] Compiling C object sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/meson-generated_sklearn_neighbors__kd_tree.pyx.c.o
  FAILED: sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/meson-generated_sklearn_neighbors__kd_tree.pyx.c.o
  cc -Isklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p -Isklearn/neighbors -I../sklearn/neighbors -I../../../pip-build-env-0jwmo4n5/overlay/lib/python3.12/site-packages/numpy/_core/include -I/usr/local/include/python3.12 -fvisibility=hidden -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c11 -O3 -Wno-unused-but-set-variable -Wno-unused-function -Wno-conversion -Wno-misleading-indentation -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION -MD -MQ sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/meson-generated_sklearn_neighbors__kd_tree.pyx.c.o -MF sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/meson-generated_sklearn_neighbors__kd_tree.pyx.c.o.d -o sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/meson-generated_sklearn_neighbors__kd_tree.pyx.c.o -c sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree64__recursive_build’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:31028:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  31028 |   __pyx_v_idx_array = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_1)) ))));
        |                     ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree64__query_radius_single’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:38433:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  38433 |   __pyx_v_idx_array = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_2)) ))));
        |                     ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree64__kde_single_breadthfirst’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:38982:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  38982 |   __pyx_v_idx_array = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_2)) ))));
        |                     ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree64__kde_single_depthfirst’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:39887:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  39887 |   __pyx_v_idx_array = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_2)) ))));
        |                     ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree64__two_point_single’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:40497:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  40497 |   __pyx_v_idx_array = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_2)) ))));
        |                     ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree64__two_point_dual’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:40900:22: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  40900 |   __pyx_v_idx_array1 = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_1)) ))));
        |                      ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:40910:22: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  40910 |   __pyx_v_idx_array2 = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_other->idx_array.data) + __pyx_t_1)) ))));
        |                      ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree32__recursive_build’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:44973:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  44973 |   __pyx_v_idx_array = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_1)) ))));
        |                     ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree32__query_radius_single’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:52387:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  52387 |   __pyx_v_idx_array = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_2)) ))));
        |                     ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree32__kde_single_breadthfirst’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:52936:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  52936 |   __pyx_v_idx_array = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_2)) ))));
        |                     ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree32__kde_single_depthfirst’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:53841:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  53841 |   __pyx_v_idx_array = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_2)) ))));
        |                     ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree32__two_point_single’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:54451:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  54451 |   __pyx_v_idx_array = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_2)) ))));
        |                     ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_12BinaryTree32__two_point_dual’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:54854:22: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  54854 |   __pyx_v_idx_array1 = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_self->idx_array.data) + __pyx_t_1)) ))));
        |                      ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:54864:22: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  54864 |   __pyx_v_idx_array2 = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_intp_t const  *) __pyx_v_other->idx_array.data) + __pyx_t_1)) ))));
        |                      ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_init_node64’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:56748:24: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  56748 |   __pyx_v_lower_bounds = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_float64_t const  *) ( /* dim=2 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_float64_t const  *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_tree->node_bounds.data + __pyx_t_1 * __pyx_v_tree->node_bounds.strides[0]) ) + __pyx_t_2 * __pyx_v_tree->node_bounds.strides[1]) )) + __pyx_t_3)) ))));
        |                        ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:56760:24: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  56760 |   __pyx_v_upper_bounds = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_float64_t const  *) ( /* dim=2 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_float64_t const  *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_tree->node_bounds.data + __pyx_t_3 * __pyx_v_tree->node_bounds.strides[0]) ) + __pyx_t_2 * __pyx_v_tree->node_bounds.strides[1]) )) + __pyx_t_1)) ))));
        |                        ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_init_node32’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:58575:24: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  58575 |   __pyx_v_lower_bounds = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_float32_t const  *) ( /* dim=2 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_float32_t const  *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_tree->node_bounds.data + __pyx_t_1 * __pyx_v_tree->node_bounds.strides[0]) ) + __pyx_t_2 * __pyx_v_tree->node_bounds.strides[1]) )) + __pyx_t_3)) ))));
        |                        ^
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:58587:24: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  58587 |   __pyx_v_upper_bounds = (&(*((__pyx_t_7sklearn_5utils_9_typedefs_float32_t const  *) ( /* dim=2 */ ((char *) (((__pyx_t_7sklearn_5utils_9_typedefs_float32_t const  *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_tree->node_bounds.data + __pyx_t_3 * __pyx_v_tree->node_bounds.strides[0]) ) + __pyx_t_2 * __pyx_v_tree->node_bounds.strides[1]) )) + __pyx_t_1)) ))));
        |                        ^
  during GIMPLE pass: vect
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c: In function ‘__pyx_f_7sklearn_9neighbors_8_kd_tree_min_rdist_dual32’:
  sklearn/neighbors/_kd_tree.cpython-312-aarch64-linux-gnu.so.p/sklearn/neighbors/_kd_tree.pyx.c:59630:67: internal compiler error: in vect_transform_reduction, at tree-vect-loop.cc:7457
  59630 | static CYTHON_INLINE __pyx_t_7sklearn_5utils_9_typedefs_float64_t __pyx_f_7sklearn_9neighbors_8_kd_tree_min_rdist_dual32(struct __pyx_obj_7sklearn_9neighbors_8_kd_tree_BinaryTree32 *__pyx_v_tree1, __pyx_t_7sklearn_5utils_9_typedefs_intp_t __pyx_v_i_node1, struct __pyx_obj_7sklearn_9neighbors_8_kd_tree_BinaryTree32 *__pyx_v_tree2, __pyx_t_7sklearn_5utils_9_typedefs_intp_t __pyx_v_i_node2) {
        |                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  0x17481f7 internal_error(char const*, ...)
        ???:0
  0x66f88f fancy_abort(char const*, int, char const*)
        ???:0
  0xdc62fb vect_transform_reduction(_loop_vec_info*, _stmt_vec_info*, gimple_stmt_iterator*, gimple**, _slp_tree*)
        ???:0
  0x170dc9f vect_transform_stmt(vec_info*, _stmt_vec_info*, gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
        ???:0
  0xdd3a8f vect_transform_loop(_loop_vec_info*, gimple*)
        ???:0
  Please submit a full bug report, with preprocessed source (by using -freport-bug).
  Please include the complete backtrace with any bug report.
  See <file:///usr/share/doc/gcc-12/README.Bugs> for instructions.
```

### Versions

```shell
1.5.2 and 1.7.0
```

COMMENT:
For completeness' sake, I think our arm pipeline currently uses gcc 13.3.0, so I guess gcc 13.3.0 should be recent enough.

See the info from the meson setup in the [build log](https://github.com/scikit-learn/scikit-learn/actions/runs/16471476299/job/46561619908#step:4:59):

```
  The Meson build system
  Version: 1.8.2
  Source dir: /home/runner/work/scikit-learn/scikit-learn
  Build dir: /home/runner/work/scikit-learn/scikit-learn/.mesonpy-hf1g4p5c
  Build type: native build
  Project name: scikit-learn
  Project version: 1.8.dev0
  C compiler for the host machine: ccache cc (gcc 13.3.0 "cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0")
  C linker for the host machine: cc ld.bfd 2.42
  C++ compiler for the host machine: ccache c++ (gcc 13.3.0 "c++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0")
  C++ linker for the host machine: c++ ld.bfd 2.42
  Cython compiler for the host machine: cython (cython 3.1.2)
```

libgcc 15 in the lock-file is a dependency of python, but we don't install a compiler in the conda environment we use the system one.

Labels: Bug, Needs Triage