This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/24451] New: [gomp] Return out of parallel loop not rejected


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]