[Bug c++/69362] New: ICE when doing a pragma reduction with the wrong variable

ryan.burn at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jan 19 18:25:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69362

            Bug ID: 69362
           Summary: ICE when doing a pragma reduction with the wrong
                    variable
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ryan.burn at gmail dot com
  Target Milestone: ---

The below code when compiled with -fcilkplus gives the following ICE:

main.cpp: In function ‘double t1(double*, int)’:
main.cpp:4:3: internal compiler error: in build2_stat, at tree.c:4433
   for(int i=0; i<N; ++i) {
   ^~~

0xf90323 build2_stat(tree_code, tree_node*, tree_node*, tree_node*)
        ../../src/gcc/tree.c:4432
0xc05d27 lower_rec_input_clauses
        ../../src/gcc/omp-low.c:5197
0xc0aaef lower_omp_for
        ../../src/gcc/omp-low.c:14449
0xbfaa66 lower_omp_1
        ../../src/gcc/omp-low.c:16349
0xbfaa66 lower_omp
        ../../src/gcc/omp-low.c:16481
0xbfa6ad lower_omp_1
        ../../src/gcc/omp-low.c:16334
0xbfa6ad lower_omp
        ../../src/gcc/omp-low.c:16481
0xbfa6ad lower_omp_1
        ../../src/gcc/omp-low.c:16334
0xbfa6ad lower_omp
        ../../src/gcc/omp-low.c:16481
0xc019e9 execute_lower_omp
        ../../src/gcc/omp-low.c:16519
0xc019e9 execute
        ../../src/gcc/omp-low.c:16556
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

////////////////////////////////////////////////////////////////////
double t1(double* x, int N) {
  double result = 0;
#pragma simd reduction(+:x)
  for(int i=0; i<N; ++i) {
    result += x[i];
  }
  return result;
}
////////////////////////////////////////////////////////////////////


More information about the Gcc-bugs mailing list