https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66609
--- Comment #2 from Rich Felker <bugdal at aerifal dot cx> --- The patch in comment 1 applies successfully to GCC 5.2.0 and fixes both the test case and the real-world code I was experiencing problems with. Unfortunately it doesn't apply to some of the older GCC versions I need to support, but I think I can backport it. Thanks!