public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58706] New: ICE with lambda in OpenMP for-loop
@ 2013-10-12 21:44 reichelt at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: reichelt at gcc dot gnu.org @ 2013-10-12 21:44 UTC (permalink / raw)
  To: gcc-bugs

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<typename T> void foo()
{
#pragma omp for
  for (T i = [](){ return 0; }(); i < 10; ++i)
    ;
}

void bar()
{
  foo<int>();
}
===================================================

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.]


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-10-12 21:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-12 21:44 [Bug c++/58706] New: ICE with lambda in OpenMP for-loop reichelt at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).