From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19953 invoked by alias); 12 Oct 2013 21:44:03 -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 19929 invoked by uid 48); 12 Oct 2013 21:44:00 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58706] New: ICE with lambda in OpenMP for-loop Date: Sat, 12 Oct 2013 21:44: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.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: reichelt at gcc dot gnu.org 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-10/txt/msg00702.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58706 Bug ID: 58706 Summary: ICE with lambda in OpenMP for-loop Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following valid code snippet (compiled with "-std=c++11 -fopenmp") triggers an ICE since GCC 4.5.0 (when lambdas were introduced): =================================================== template void foo() { #pragma omp for for (T i = [](){ return 0; }(); i < 10; ++i) ; } void bar() { foo(); } =================================================== bug.cc: In instantiation of 'void foo() [with T = int]': bug.cc:10:12: required from here bug.cc:3:9: internal compiler error: Segmentation fault #pragma omp for ^ 0xb15dff crash_signal ../../gcc/gcc/toplev.c:335 0x6cabd2 contains_struct_check ../../gcc/gcc/tree.h:2787 0x6cabd2 finish_omp_for(unsigned int, tree_code, tree_node*, tree_node*, tree_node*, tree_node*, tree_node*, tree_node*, tree_node*) ../../gcc/gcc/cp/semantics.c:6321 0x5aae3d tsubst_expr ../../gcc/gcc/cp/pt.c:13596 0x5a9db7 tsubst_expr ../../gcc/gcc/cp/pt.c:13384 0x5a6d69 instantiate_decl(tree_node*, int, bool) ../../gcc/gcc/cp/pt.c:19603 0x5e4c6f instantiate_pending_templates(int) ../../gcc/gcc/cp/pt.c:19715 0x6204c6 cp_write_global_declarations() ../../gcc/gcc/cp/decl2.c:4121 Please submit a full bug report, [etc.]