https://bugs.freedesktop.org/show_bug.cgi?id=109048
--- Comment #14 from Henri Valta cg@jakorasia.info --- (In reply to Timothy Arceri from comment #13)
What version of GCC are you using to build Mesa?
It's from arch linux package 8.2.1+20181127-1
I wonder if this is actually a compiler bug rather than a Mesa bug given your find above.
I'll open a bug for the arch mesa package and link it to this, so the people there who know what's going on with the gcc version might be able to help.