From 3fc42de4e3688073067cf604e9dd4a3bba9cb1fa Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Fri, 31 May 2013 09:26:20 +0000 Subject: [PATCH] inpttype.h: Use O1 instead of O0 on the critical function [Hans Ostermeyer] Some benchmarking for different compilers and levels (seconds): gcc 4.4.7: O0=ICE O1=38.62 O2=58.13 O3=3721.11 gcc 4.5.4: O0=6.21 O1=25.63 O2=38.24 O3=3085.74 gcc 4.6.4: O0=4.95 O1=15.89 O2=32.94 O3=48.95 gcc 4.7.3: O0=6.11 O1=22.03 O2=126.41 O3=348.02 Hans tracked a wrong compile issue in 4.7 to the use of -O0. That table shows that -O1 is acceptable for everybody. Note that it isn't a time critical function, and it doesn't make sense to optimize it much (it's a bunch of calls to another function which itself is optimized and no computations). --- src/emu/inpttype.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/inpttype.h b/src/emu/inpttype.h index a6d9c036b65..933e68a5702 100644 --- a/src/emu/inpttype.h +++ b/src/emu/inpttype.h @@ -49,7 +49,7 @@ typelist.append(*global_alloc(input_type_entry(IPT_##_type, IPG_##_group, (_player == 0) ? _player : (_player) - 1, (_player == 0) ? #_type : ("P" #_player "_" #_type), _name, _seq, _decseq, _incseq))); #if defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) -__attribute__((optimize("O0"))) +__attribute__((optimize("O1"))) #endif #ifdef _MSC_VER #pragma optimize("", off)