On Sun, Feb 14, 2010 at 8:06 PM, Joakim Tjernlund <joakim.tjernl...@transmode.se> wrote: > Richard Guenther <richard.guent...@gmail.com> wrote on 2010/02/14 19:05:24: >> >> On Sun, Feb 14, 2010 at 5:51 PM, Joakim Tjernlund >> <joakim.tjernl...@transmode.se> wrote: >> > >> > Noticed while optimizing crc16 that gcc -O performed much better >> > than gcc -O2 while doing crc16: >> >> Reducing the noise by adding a loop with trip count 64, making sure >> my powersaving model is fixed at performance I see >> >> -O1: >> crc1:f532 crc2:f532 >> crc16 tv_res:1 :387072 >> CRC16 tv_res:1 :100397 >> >> -O2: >> crc1:f532 crc2:f532 >> crc16 tv_res:1 :301706 >> CRC16 tv_res:1 :77103 > > The new CRC16 seems a lot faster :) > >> >> so it's faster, with GCC 4.4.3. >> >> It's indeed slower with GCC 4.3.4 though. >> >> But your benchmark seems artificial enough that GCC 4.5 optimizes >> it away - it manages to see that CRC16 and crc16 are pure functions, >> thus it only retains their last calls. At least at -O1, at -O2 it inlines >> all functions into main and isn't that clever anymore in the end. >> >> So - beware of benchmarks. > > the warmup isn't really needed after I added memset and inline or not should > not matter that much are only used once so I think my > conclusion still stands: gcc 4.3.4 is slower with -O2 than -O1 > > Glad to hear that newer versions are back on track, does than mean > that this won't be fixed in gcc 4.3.x series?
Definitely. The gcc 4.3.x series are in deep maintainance mode already. Richard.