Fix gcc OOM error when compiling in release mode

O3 leads to gcc bailing out with OOM on e.g. MinGW with gcc
4.7.3 onwards.

Task-number: QTBUG-29099
Change-Id: I3ce49794fa4857e756d2994454d4144cfb44ce58
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>