[Bug debug/44689] New: -fenable-icf-debug -fprofile-generate causes segfault in cp_function_decl_explicit_p

zsojka at seznam dot cz gcc-bugzilla@gcc.gnu.org
Sun Jun 27 11:36:00 GMT 2010


Command line:
$ g++ -g -fenable-icf-debug -fprofile-generate testcase.C

----- testcase.C -----
void foo() {}
----------------------
(actually reduced from g++.dg/debug/dwarf2/icf.C)

Valgrind output:
$ valgrind --trace-children=yes -q
/mnt/svn/gcc-trunk/binary-161428-lto-fortran-checking-yes-rtl-df/bin/g++ -g
-fenable-icf-debug -fprofile-generate testcase.C
==20380== Invalid read of size 2
==20380==    at 0x629127: cp_function_decl_explicit_p (cp-objcp-common.c:159)
==20380==    by 0x7705A7: gen_subprogram_die (dwarf2out.c:18598)
==20380==    by 0x76681D: force_decl_die (dwarf2out.c:20191)
==20380==    by 0x7669AF: dwarf2out_direct_call (dwarf2out.c:21053)
==20380==    by 0x7C9743: final_scan_insn (final.c:2698)
==20380==    by 0x7C9F3D: final (final.c:1719)
==20380==    by 0x7CA188: rest_of_handle_final (final.c:4245)
==20380==    by 0x8E8DAD: execute_one_pass (passes.c:1580)
==20380==    by 0x8E9044: execute_pass_list (passes.c:1635)
==20380==    by 0x8E9056: execute_pass_list (passes.c:1636)
==20380==    by 0x8E9056: execute_pass_list (passes.c:1636)
==20380==    by 0xA277F5: tree_rest_of_compilation (tree-optimize.c:420)
==20380==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==20380== 
testcase.C:1:13: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r161428 - crash
r153685 - crash
4.4.4 and 4.3.5 don't recognise -fenable-icf-debug


-- 
           Summary: -fenable-icf-debug -fprofile-generate causes segfault in
                    cp_function_decl_explicit_p
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zsojka at seznam dot cz
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44689



More information about the Gcc-bugs mailing list