http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53880
--- Comment #3 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-07-08 07:08:13 UTC --- Unfortunately jimis' patch from Bug 53525 doesn't help much: c++ -c -o pch.hpp.gch /usr/include/boost/math/special_functions.hpp 156.69s user 0.33s system 99% cpu 2:37.50 total From "perf top": 99.78% cc1plus [.] gt_pch_p_9line_maps 0.04% cc1plus [.] htab_find_with_hash 0.02% cc1plus [.] gt_pch_p_14lang_tree_node 0.02% libc-2.16.so [.] fwrite_unlocked ▒ 0.01% libc-2.16.so [.] __mempcpy 0.01% [kernel] [k] do_timer Zoom into gt_pch_p_9line_maps: │ size_t l3 = (size_t)(((*x).info_macro).used); │ if ((*x).info_macro.maps != NULL) { │ size_t i3; │ for (i3 = 0; i3 != (size_t)(l3); i3++) { 3.89 │109: cmp %rcx,%rbx 3.69 │ nop 3.15 │ ↓ je 188 3.11 │112: mov 0x18(%rbp),%rax 3.04 │ add $0x1,%rbx │ break; │ } │ } │ │ void │ gt_pch_p_9line_maps (ATTRIBUTE_UNUSED void *this_obj, 2.76 │11a: lea (%rbx,%rbx,4),%r15 3.53 │ shl $0x3,%r15 │ { │ size_t l3 = (size_t)(((*x).info_macro).used); │ if ((*x).info_macro.maps != NULL) { │ size_t i3; │ for (i3 = 0; i3 != (size_t)(l3); i3++) { │ switch (((*x).info_macro.maps[i3]).reason == LC_ENTER_MACRO) 3.46 │ lea (%rax,%r15,1),%rdi 3.42 │ cmpb $0x4,0x4(%rdi) 4.40 │ ↑ jne 100 │ case 1: │ { │ size_t l4 = (size_t)(2 * ((*x).info_macro.maps[i3].d.macro).n_tokens); │ { │ union tree_node * x5 = │ ((*x).info_macro.maps[i3].d.macro.macro) ? HT_IDENT_TO_GCC_IDENT (HT_NODE (((*x).info_macro.maps[i3].d.macro.macro))) 4.38 │ mov 0x8(%rdi),%rsi 4.25 │ xor %edx,%edx 2.22 │ lea -0x18(%rsi),%r8 2.16 │ test %rsi,%rsi 2.68 │ cmovne %r8,%rdx │ if ((void *)((*x).info_macro.maps) == this_obj) 2.72 │ cmp %rax,%r14 │ break; │ case 1: │ { │ size_t l4 = (size_t)(2 * ((*x).info_macro.maps[i3].d.macro).n_tokens); │ { │ union tree_node * x5 = 2.62 │ mov %rdx,0x18(%rsp) │ ((*x).info_macro.maps[i3].d.macro.macro) ? HT_IDENT_TO_GCC_IDENT (HT_NODE (((*x).info_macro.maps[i3].d.macro.macro))) │ if ((void *)((*x).info_macro.maps) == this_obj) 2.68 │ ↓ je 1a0 │ op (&(x5), cookie); │ (*x).info_macro.maps[i3].d.macro.macro = (x5) ? CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT ((x5))) : NULL; 2.68 │147: lea 0x18(%rdx),%rsi 2.85 │ xor %eax,%eax 3.39 │ test %rdx,%rdx 3.11 │ cmovne %rsi,%rax 3.23 │ mov %rax,0x8(%rdi) │ } │ if ((*x).info_macro.maps[i3].d.macro.macro_locations != NULL) { 5.10 │ mov 0x18(%rbp),%rax 4.93 │ add %rax,%r15 5.48 │ cmpq $0x0,0x18(%r15) 3.57 │ ↑ je 109 │ size_t i4; │ for (i4 = 0; i4 != (size_t)(l4); i4++) { │ } │ if ((void *)((*x).info_macro.maps) == this_obj) 3.20 │ cmp %rax,%r14 2.82 │ ↑ jne 109 │ op (&((*x).info_macro.maps[i3].d.macro.macro_locations), cookie); │ mov %rcx,0x8(%rsp) │ lea 0x18(%r15),%rdi │ mov %r13,%rsi │ → callq *%r12 │ mov 0x8(%rsp),%rcx │ }