Work around GCC bug 54561 in a better way