Fix case where intmax_t is smaller than long long, also apply gcc-4.6 workaround to Intel which has the same bug (all versions to 15.0).