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++/69363] New: ICE when doing a pragma simd reduction with max


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

            Bug ID: 69363
           Summary: ICE when doing a pragma simd reduction with max
           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 causes this ICE:

rnburn@localhost ~/test/cilk_reduction $ /usr/local/experimental/bin/g++
-fcilkplus -O3 -march=native -c -S bug.cpp
bug.cpp: In function âdouble t1(double*, int)â:
bug.cpp:7:3: internal compiler error: Segmentation fault
   for(int i=0; i<N; ++i) {
   ^~~

0xcfba0f crash_signal
        ../../src/gcc/toplev.c:334
0xab2451 omp_add_variable
        ../../src/gcc/gimplify.c:5715
0xac523e gimplify_scan_omp_clauses
        ../../src/gcc/gimplify.c:7156
0xab637a gimplify_omp_for
        ../../src/gcc/gimplify.c:8369
0xabe54e gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../src/gcc/gimplify.c:10561
0xac1436 gimplify_stmt(tree_node**, gimple**)
        ../../src/gcc/gimplify.c:5598
0xac260d gimplify_bind_expr
        ../../src/gcc/gimplify.c:1139
0xabc772 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../src/gcc/gimplify.c:10295
0xac1436 gimplify_stmt(tree_node**, gimple**)
        ../../src/gcc/gimplify.c:5598
0xabd80b gimplify_statement_list
        ../../src/gcc/gimplify.c:1520
0xabd80b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../src/gcc/gimplify.c:10513
0xac1436 gimplify_stmt(tree_node**, gimple**)
        ../../src/gcc/gimplify.c:5598
0xac260d gimplify_bind_expr
        ../../src/gcc/gimplify.c:1139
0xabc772 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../src/gcc/gimplify.c:10295
0xac1436 gimplify_stmt(tree_node**, gimple**)
        ../../src/gcc/gimplify.c:5598
0xac3269 gimplify_body(tree_node*, bool)
        ../../src/gcc/gimplify.c:11227
0xac3896 gimplify_function_tree(tree_node*)
        ../../src/gcc/gimplify.c:11383
0x9444d7 cgraph_node::analyze()
        ../../src/gcc/cgraphunit.c:623
0x947a59 analyze_functions
        ../../src/gcc/cgraphunit.c:1078
0x948968 symbol_table::finalize_compilation_unit()
        ../../src/gcc/cgraphunit.c:2518
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.

//////////////////////////////////////////////////////////////////////////
#include <cmath>

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

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