http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57635
Bug ID: 57635 Summary: gcc hanging while compiling huge files Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: vijunag at gmail dot com to gcc Hello, I recently upgraded my compiler to 4.7.2 and I'm trying to compile a huge file containing as much as 92840 lines and gcc is taking an eternity to compile. (more than 18 hours) I see via top command that CC1 is consuming 100 percent CPU. PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 14848 vinag 25 0 485m 413m 8196 R 99.9 0.4 64:41.24 cc1 I tried to attach to CC1 in gdb and below are few snapshots of it under gdb snapshot 1 Program received signal SIGINT, Interrupt. 0x000000000052f775 in find_base_term () (gdb) bt #0 0x000000000052f775 in find_base_term () #1 0x000000000052f924 in find_base_term () #2 0x000000000052fa45 in base_alias_check () #3 0x0000000000531823 in true_dependence_1 () #4 0x0000000000531a31 in canon_true_dependence () #5 0x00000000005acf58 in cselib_invalidate_mem () #6 0x00000000005ad14c in cselib_invalidate_rtx () #7 0x00000000005ad170 in cselib_invalidate_rtx_note_stores () #8 0x0000000000816458 in note_stores () #9 0x00000000005ad935 in cselib_record_sets () #10 0x00000000005add94 in cselib_process_insn () #11 0x0000000000a4b78a in vt_initialize () #12 0x0000000000a4beda in variable_tracking_main_1 () #13 0x0000000000a4be47 in variable_tracking_main () #14 0x00000000007a6b89 in execute_one_pass () #15 0x00000000007a6ef8 in execute_pass_list () #16 0x00000000007a6f16 in execute_pass_list () #17 0x00000000007a6f16 in execute_pass_list () #18 0x00000000008ddc76 in tree_rest_of_compilation () #19 0x00000000005a0a28 in cgraph_expand_function () #20 0x00000000005a0be4 in cgraph_expand_all_functions () #21 0x00000000005a14f0 in cgraph_optimize () #22 0x000000000059f498 in cgraph_finalize_compilation_unit () #23 0x000000000049d927 in c_write_global_declarations () #24 0x000000000087865e in compile_file () #25 0x000000000087a8e7 in do_compile () #26 0x000000000087aa34 in toplev_main () #27 0x000000000052a17f in main () (gdb) c Continuing. snapshot2 (gdb) bt #0 0x000000000052f7ea in find_base_term () #1 0x000000000052f924 in find_base_term () #2 0x000000000052f7cf in find_base_term () #3 0x000000000052f924 in find_base_term () #4 0x000000000052fa45 in base_alias_check () #5 0x0000000000531823 in true_dependence_1 () #6 0x0000000000531a31 in canon_true_dependence () #7 0x00000000005acf58 in cselib_invalidate_mem () #8 0x00000000005ad14c in cselib_invalidate_rtx () #9 0x00000000005ad170 in cselib_invalidate_rtx_note_stores () #10 0x0000000000816458 in note_stores () #11 0x00000000005ad935 in cselib_record_sets () #12 0x00000000005add94 in cselib_process_insn () #13 0x0000000000a4b78a in vt_initialize () #14 0x0000000000a4beda in variable_tracking_main_1 () #15 0x0000000000a4be47 in variable_tracking_main () #16 0x00000000007a6b89 in execute_one_pass () #17 0x00000000007a6ef8 in execute_pass_list () #18 0x00000000007a6f16 in execute_pass_list () #19 0x00000000007a6f16 in execute_pass_list () #20 0x00000000008ddc76 in tree_rest_of_compilation () #21 0x00000000005a0a28 in cgraph_expand_function () #22 0x00000000005a0be4 in cgraph_expand_all_functions () #23 0x00000000005a14f0 in cgraph_optimize () #24 0x000000000059f498 in cgraph_finalize_compilation_unit () #25 0x000000000049d927 in c_write_global_declarations () #26 0x000000000087865e in compile_file () #27 0x000000000087a8e7 in do_compile () #28 0x000000000087aa34 in toplev_main () #29 0x000000000052a17f in main () I'm little bit surprised because same file I was able to compile with my older gcc compiler 3.3. i686-pc-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=~/tools/bintools/linux-x86/gcc/201302221200/bin/i686-pc-linux-gnu-gcc-wrapped COLLECT_LTO_WRAPPER=~/tools/bintools/linux-x86/gcc/201302221200/libexec/gcc/i686-pc-linux-gnu/4.7.2/lto-wrapper Target: i686-pc-linux-gnu Configured with: ../../gcc/configure --build=amd64-pc-linux-gnu --host=amd64-pc-linux-gnu --target=i686-pc-linux-gnu --enable-languages=c,c++ --prefix=~tools/bintools/linux-x86/gcc/201302221200 --enable-shared --with-headers=/tmp/201302221200/new_header/ --disable-libquadmath --disable-libgomp --disable-libssp --disable-libmudflap --disable-libitm --with-fast-fixincludes --enable-threads --site=starent --with-gnu-as --with-gnu-ld Thread model: posix gcc version 4.7.2 (GCC) i586-pc-linux-gnu-gcc -c ternary.c i586-pc-linux-gnu-gcc -v Reading specs from ~/tools/bintools/linux-x86/gcc/200608191248/lib/gcc-lib/i586-pc-linux-gnu/3.3.6/specs Configured with: ../../gcc/configure --build=i686-linux --host=i686-linux --target=i586-pc-linux-gnu --enable-languages=c,c++ --prefix=~/tools/bintools/linux-x86/gcc/200608191248 --enable-shared --with-headers=/localdisk/tmp/x86-linux/include --with-fast-fixincludes --enable-threads --site=starent --with-gnu-as --with-gnu-ld Thread model: posix gcc version 3.3.6