------- Comment #6 from hjl dot tools at gmail dot com 2009-01-17 01:41 ------- I can reproduce it on Linux/x86-64:
[...@gnu-6 gcc]$ valgrind --tool=memcheck ./cc1 -fpreprocessed x.i -quiet -dumpbase x.i -mtune=generic -auxbase x -O -version -o x.s ==30493== Memcheck, a memory error detector. ==30493== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. ==30493== Using LibVEX rev 1804, a library for dynamic binary translation. ==30493== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. ==30493== Using valgrind-3.3.0, a dynamic binary instrumentation framework. ==30493== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. ==30493== For more details, rerun with: -v ==30493== GNU C (GCC) version 4.4.0 20090114 (experimental) [trunk revision 143401] (x86_64-unknown-linux-gnu) compiled by GNU C version 4.3.2 20081105 (Red Hat 4.3.2-7), GMP version 4.2.2, MPFR version 2.3.2. GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: c755410401678804359bd441117db6be ==30493== Invalid read of size 2 ==30493== at 0xE8FB49: process_bb_node_for_hard_reg_moves (ira-costs.c:1428) ==30493== by 0xE8772C: ira_traverse_loop_tree (ira-build.c:1390) ==30493== by 0xE8FF69: setup_allocno_cover_class_and_costs (ira-costs.c:1496) ==30493== by 0xE90254: ira_costs (ira-costs.c:1596) ==30493== by 0xE8B9F7: ira_build (ira-build.c:2775) ==30493== by 0xE830DB: ira (ira.c:1926) ==30493== by 0xE837A1: rest_of_handle_ira (ira.c:2095) ==30493== by 0x7DCCE1: execute_one_pass (passes.c:1279) ==30493== by 0x7DCF2A: execute_pass_list (passes.c:1328) ==30493== by 0x7DCF48: execute_pass_list (passes.c:1329) ==30493== by 0x95210C: tree_rest_of_compilation (tree-optimize.c:419) ==30493== by 0xB9A0F5: cgraph_expand_function (cgraphunit.c:1047) ==30493== Address 0x9f24506 is 806 bytes inside a block of size 1,352 free'd ==30493== at 0x4A0609F: free (vg_replace_malloc.c:323) ==30493== by 0x814995: init_reg_sets_1 (regclass.c:687) ==30493== by 0x814C95: init_regs (regclass.c:738) ==30493== by 0xB503E8: ix86_maybe_switch_abi (i386.c:4627) ==30493== by 0xE1B437: gimple_expand_cfg (cfgexpand.c:2313) ==30493== by 0x7DCCE1: execute_one_pass (passes.c:1279) ==30493== by 0x7DCF2A: execute_pass_list (passes.c:1328) ==30493== by 0x95210C: tree_rest_of_compilation (tree-optimize.c:419) ==30493== by 0xB9A0F5: cgraph_expand_function (cgraphunit.c:1047) ==30493== by 0xB9A2A9: cgraph_expand_all_functions (cgraphunit.c:1106) ==30493== by 0xB9A847: cgraph_optimize (cgraphunit.c:1311) ==30493== by 0x42EBA0: c_write_global_declarations (c-decl.c:8074) ==30493== ==30493== Invalid read of size 2 ==30493== at 0xE8FB10: process_bb_node_for_hard_reg_moves (ira-costs.c:1428) ==30493== by 0xE8772C: ira_traverse_loop_tree (ira-build.c:1390) ==30493== by 0xE8FF69: setup_allocno_cover_class_and_costs (ira-costs.c:1496) ==30493== by 0xE90254: ira_costs (ira-costs.c:1596) ==30493== by 0xE8B9F7: ira_build (ira-build.c:2775) ==30493== by 0xE830DB: ira (ira.c:1926) ==30493== by 0xE837A1: rest_of_handle_ira (ira.c:2095) ==30493== by 0x7DCCE1: execute_one_pass (passes.c:1279) ==30493== by 0x7DCF2A: execute_pass_list (passes.c:1328) ==30493== by 0x7DCF48: execute_pass_list (passes.c:1329) ==30493== by 0x95210C: tree_rest_of_compilation (tree-optimize.c:419) ==30493== by 0xB9A0F5: cgraph_expand_function (cgraphunit.c:1047) ==30493== Address 0x9f244a2 is 706 bytes inside a block of size 1,352 free'd ==30493== at 0x4A0609F: free (vg_replace_malloc.c:323) ==30493== by 0x814995: init_reg_sets_1 (regclass.c:687) ==30493== by 0x814C95: init_regs (regclass.c:738) ==30493== by 0xB503E8: ix86_maybe_switch_abi (i386.c:4627) ==30493== by 0xE1B437: gimple_expand_cfg (cfgexpand.c:2313) ==30493== by 0x7DCCE1: execute_one_pass (passes.c:1279) ==30493== by 0x7DCF2A: execute_pass_list (passes.c:1328) ==30493== by 0x95210C: tree_rest_of_compilation (tree-optimize.c:419) ==30493== by 0xB9A0F5: cgraph_expand_function (cgraphunit.c:1047) ==30493== by 0xB9A2A9: cgraph_expand_all_functions (cgraphunit.c:1106) ==30493== by 0xB9A847: cgraph_optimize (cgraphunit.c:1311) ==30493== by 0x42EBA0: c_write_global_declarations (c-decl.c:8074) ==30493== ==30493== Invalid read of size 2 ==30493== at 0xE93708: update_copy_costs (ira-color.c:287) ==30493== by 0xE947AB: assign_hard_reg (ira-color.c:655) ==30493== by 0xE96D15: pop_allocnos_from_stack (ira-color.c:1336) ==30493== by 0xE98264: color_allocnos (ira-color.c:1836) ==30493== by 0xE988E0: color_pass (ira-color.c:1936) ==30493== by 0xE876FB: ira_traverse_loop_tree (ira-build.c:1381) ==30493== by 0xE99096: do_coloring (ira-color.c:2080) ==30493== by 0xE9C13A: color (ira-color.c:3232) ==30493== by 0xE9C592: ira_color (ira-color.c:3335) ==30493== by 0xE83124: ira (ira.c:1938) ==30493== by 0xE837A1: rest_of_handle_ira (ira.c:2095) ==30493== by 0x7DCCE1: execute_one_pass (passes.c:1279) ==30493== Address 0x9f25fac is 628 bytes inside a block of size 1,352 free'd ==30493== at 0x4A0609F: free (vg_replace_malloc.c:323) ==30493== by 0x814995: init_reg_sets_1 (regclass.c:687) ==30493== by 0x814C95: init_regs (regclass.c:738) ==30493== by 0xB503E8: ix86_maybe_switch_abi (i386.c:4627) ==30493== by 0xE1B437: gimple_expand_cfg (cfgexpand.c:2313) ==30493== by 0x7DCCE1: execute_one_pass (passes.c:1279) ==30493== by 0x7DCF2A: execute_pass_list (passes.c:1328) ==30493== by 0x95210C: tree_rest_of_compilation (tree-optimize.c:419) ==30493== by 0xB9A0F5: cgraph_expand_function (cgraphunit.c:1047) ==30493== by 0xB9A2A9: cgraph_expand_all_functions (cgraphunit.c:1106) ==30493== by 0xB9A847: cgraph_optimize (cgraphunit.c:1311) ==30493== by 0x42EBA0: c_write_global_declarations (c-decl.c:8074) ==30493== ==30493== Invalid read of size 2 ==30493== at 0xE936CF: update_copy_costs (ira-color.c:287) ==30493== by 0xE947AB: assign_hard_reg (ira-color.c:655) ==30493== by 0xE96D15: pop_allocnos_from_stack (ira-color.c:1336) ==30493== by 0xE98264: color_allocnos (ira-color.c:1836) ==30493== by 0xE988E0: color_pass (ira-color.c:1936) ==30493== by 0xE876FB: ira_traverse_loop_tree (ira-build.c:1381) ==30493== by 0xE99096: do_coloring (ira-color.c:2080) ==30493== by 0xE9C13A: color (ira-color.c:3232) ==30493== by 0xE9C592: ira_color (ira-color.c:3335) ==30493== by 0xE83124: ira (ira.c:1938) ==30493== by 0xE837A1: rest_of_handle_ira (ira.c:2095) ==30493== by 0x7DCCE1: execute_one_pass (passes.c:1279) ==30493== Address 0x9f25db8 is 128 bytes inside a block of size 1,352 free'd ==30493== at 0x4A0609F: free (vg_replace_malloc.c:323) ==30493== by 0x814995: init_reg_sets_1 (regclass.c:687) ==30493== by 0x814C95: init_regs (regclass.c:738) ==30493== by 0xB503E8: ix86_maybe_switch_abi (i386.c:4627) ==30493== by 0xE1B437: gimple_expand_cfg (cfgexpand.c:2313) ==30493== by 0x7DCCE1: execute_one_pass (passes.c:1279) ==30493== by 0x7DCF2A: execute_pass_list (passes.c:1328) ==30493== by 0x95210C: tree_rest_of_compilation (tree-optimize.c:419) ==30493== by 0xB9A0F5: cgraph_expand_function (cgraphunit.c:1047) ==30493== by 0xB9A2A9: cgraph_expand_all_functions (cgraphunit.c:1106) ==30493== by 0xB9A847: cgraph_optimize (cgraphunit.c:1311) ==30493== by 0x42EBA0: c_write_global_declarations (c-decl.c:8074) ==30493== ==30493== ERROR SUMMARY: 19 errors from 4 contexts (suppressed: 4 from 1) ==30493== malloc/free: in use at exit: 414,777 bytes in 1,526 blocks. ==30493== malloc/free: 12,711 allocs, 11,185 frees, 8,719,282 bytes allocated. ==30493== For counts of detected errors, rerun with: -v ==30493== searching for pointers to 1,526 not-freed blocks. ==30493== checked 3,778,992 bytes. ==30493== ==30493== LEAK SUMMARY: ==30493== definitely lost: 16 bytes in 1 blocks. ==30493== possibly lost: 0 bytes in 0 blocks. ==30493== still reachable: 414,761 bytes in 1,525 blocks. ==30493== suppressed: 0 bytes in 0 blocks. ==30493== Rerun with --leak-check=full to see details of leaked memory. [...@gnu-6 gcc]$ -- hjl dot tools at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vmakarov at redhat dot com Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2009-01-17 01:41:24 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38869