work around a gcc optimizer bug