Be more lenient when parsing GCC version number

See RT #87910. Thanks to James Hull for the report.