From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23966 invoked by alias); 22 Nov 2013 16:24:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 23895 invoked by uid 48); 22 Nov 2013 16:24:20 -0000 From: "stepik-777 at mail dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59255] New: Segmentation fault with std::function and -fprofile-use Date: Fri, 22 Nov 2013 16:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: stepik-777 at mail dot ru X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg02329.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59255 Bug ID: 59255 Summary: Segmentation fault with std::function and -fprofile-use Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: critical Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: stepik-777 at mail dot ru Consider the following simple program: #include int main(int argc, char *argv[]) { std::function f = []{ return 0; }; return 0; } I'm compiling it with these commands: g++ -std=c++11 -fprofile-generate -c test.cpp -o test.o g++ -std=c++11 -fprofile-generate -o test test.o ./test # execute to generate profiling data g++ -std=c++11 -fprofile-use -c test.cpp -o test.o #g++ -std=c++11 -fprofile-use -o test test.o This causes segfault when compiling with -fprofile-use: test.cpp: In destructor 'std::_Function_base::~_Function_base()': test.cpp:7:1: internal compiler error: Segmentation fault } ^ Tested with these two gcc versions: g++ (Ubuntu/Linaro 4.8.1-10ubuntu8) 4.8.1 g++.exe (rev0, Built by MinGW-W64 project) 4.8.2