This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/24451] New: [gomp] Return out of parallel loop not rejected
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Oct 2005 11:42:38 -0000
- Subject: [Bug c/24451] New: [gomp] Return out of parallel loop not rejected
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code is accepted with -fopenmp although a return from a
parallel for loop is not allowed:
================================
void foo()
{
int i;
#pragma omp parallel for
for ( i=0; i<10; ++i )
return;
}
================================
When a value is returned, we get an ICE instead:
================================
int foo()
{
int i;
#pragma omp parallel for
for ( i=0; i<10; ++i )
return 0;
}
================================
bug.c: In function '__omp_fn.1':
bug.c:4: internal compiler error: in expand_expr_real_1, at expr.c:8307
Please submit a full bug report, [etc.]
The same holds for the C++ frontend; the ICE is just in a different position.
--
Summary: [gomp] Return out of parallel loop not rejected
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, accepts-invalid, openmp
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24451