This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMDSEVM6678: C/C++ compiler crash with OpenMP

Part Number: TMDSEVM6678

Tool/software: TI C/C++ Compiler

Dear All,

I created a default RTSC project with OpenMP support. I was able to get the "omp parallel" and "omp parallel for" constructs to work and got expected outputs. 

However, when I tried to use the "omp parallel sections" construct, the compiler crashed. The code:

#include <omp.h>
#include <stdio.h>

void ompTask()
{
    int tid = omp_get_thread_num();
    printf("Task-%d", tid);
}

int main (int argc, char *argv[])
{

omp_set_num_threads(4);
#pragma omp parallel
#pragma omp sections
{
    #pragma omp section
    ompTask();
    #pragma omp section
    ompTask();
    #pragma omp section
    ompTask(); 
    #pragma omp section
    ompTask();
}
return 0;

}

Error Dialog Box Message: "TMS320C6x C/C++ Parser v8.2.2 has stopped working"

I have already tried 

a. removing the first "#pragma omp section"

b. replacing the "#pragma omp parallel" and "#pragma omp sections" with "#pragma omp parallel sections" which gives "error #1510 : Syntax Error in OpenMP pragma" 

c. removing "#pragma omp parallel" altogether.

 

Please suggest

Regards

Harash

  • Unfortunately, I am unable to reproduce the problem.  Please show the build options exactly as the compiler sees them.

    Thanks and regards,

    -George

  • Dear Mr. George,

       The compiler command executed by Code Composer Studio and as seen in its console window is as follows

    "C:/ti/ti-cgt-c6000_8.2.2/bin/cl6x" -mv6600 -O2 --include_path="C:/ti/openmp_dsp_c667x_2_06_02_01/packages/ti/runtime/openmp" --include_path="D:/Projects/Junk/CCS/OpenMPBase" --include_path="C:/ti/ti-cgt-c6000_8.2.2/include" --diag_warning=225 --diag_wrap=off --display_error_number --multithread --openmp --preproc_with_compile --preproc_dependency="hello.d_raw" --cmd_file="configPkg/compiler.opt" "../hello.cpp"

    The error displayed image 

    Regards

    Harash

  • Thank you for the additional detail.  I can reproduce the problem.  The main clue is this one ...

    Harash Sharma said:
    "../hello.cpp"

    The C6000 compiler OpenMP solution does not support C++.  You must put all your OpenMP code in C files with the file extension ".c" and not ".cpp".  

    Even so, the compiler should not fail like that.  So I filed CODEGEN-4471 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George