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

             Bug #: 50741
           Summary: remove_unused_locals causes seg fault
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: dcb...@hotmail.com


Created attachment 25512
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25512
C++ source code

I just tried to compile the package fusecompress_offline1-1.99.19-7
on latest trunk snapshot 20111015 on an AMD x86_64 box.

The compiler said

CompressedMagic.cpp: In constructor 'CompressedMagic::CompressedMagic()':
CompressedMagic.cpp:106:1: 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.

valgrind said

==8702== Invalid read of size 1
==8702==    at 0xB0B2B6: mark_all_vars_used_1(tree_node**, int*, void*)
(tree-fl
ow-inline.h:562)
==8702==    by 0xC1098D: walk_tree_1(tree_node**, tree_node* (*)(tree_node**,
in
t*, void*), void*, pointer_set_t*, tree_node* (*)(tree_node**, int*, tree_node*
(*)(tree_node**, int*, void*), void*, pointer_set_t*)) (tree.c:10455)
==8702==    by 0xC10F7A: walk_tree_1(tree_node**, tree_node* (*)(tree_node**,
in
t*, void*), void*, pointer_set_t*, tree_node* (*)(tree_node**, int*, tree_node*
(*)(tree_node**, int*, void*), void*, pointer_set_t*)) (tree.c:10533)
==8702==    by 0xB0C049: remove_unused_locals() (tree-ssa-live.c:595)
==8702==    by 0x99165C: execute_function_todo(void*) (passes.c:1695)
==8702==    by 0x991E7C: execute_todo(unsigned int) (passes.c:1741)
==8702==    by 0x994FC9: execute_one_pass(opt_pass*) (passes.c:2087)
==8702==    by 0x9952C4: execute_pass_list(opt_pass*) (passes.c:2119)
==8702==    by 0x9944F3: do_per_function_toporder(void (*)(void*), void*)
(passe
s.c:1606)
==8702==    by 0x995745: execute_ipa_pass_list(opt_pass*) (passes.c:2437)
==8702==    by 0x78A362: cgraph_optimize() (cgraphunit.c:2011)
==8702==    by 0x78A8D9: cgraph_finalize_compilation_unit() (cgraphunit.c:1312)
==8702==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==8702==

Preprocessed source code attached. Flag -O2 required.

Reply via email to