Using -O1 instead of -O2, or adding -fno-schedule-insns2 (keeping -O2) allows to successfully compile the file. Thank you for the support.