Seg fault of GCC on aarch64 device in 22.03.2

I am getting regular seg faults of GCC on my aarch64 MT7622 SoC BPI-R2 device. It does not appear to be an issue in current snapshots.

I'm curious if this is an aarch64-wide bug, or just something to do with the MT7622 or the BPI-R2 specifically.

My experience with gcc seg faults in the past have generally been attributed to hardware (bad memory or high temps). In this case, it only happens in certain source files but when it does it is 100% reproducible. There is a small library, for example, where it happens on the first file:

git clone https://github.com/void-linux/musl-fts
cd musl-fts
./bootstrap.sh
./configure --prefix=/usr
make
...
make[1]: Entering directory '/mnt/workbench/root/devel/musl-fts'
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT fts.lo -MD -MP -MF .deps/fts.Tpo -c -o fts.lo fts.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -O2 -MT fts.lo -MD -MP -MF .deps/fts.Tpo -c fts.c  -fPIC -DPIC -o .libs/fts.o
during GIMPLE pass: ivopts
fts.c: In function 'fts_sort':
fts.c:1014:1: internal compiler error: Segmentation fault
 1014 | fts_sort(FTS *sp, FTSENT *head, size_t nitems)
      | ^~~~~~~~