https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109181
--- Comment #6 from waffl3x <waffl3x at protonmail dot com> --- PR 110927 presents a similar use case that originally lead me to this bug, I also posted the workarounds that I had since discovered there. If anyone coming across this bug is looking for a solution you can find them there.