Problem with reducers and array notation (__sec_reduce_min)

Problem with reducers and array notation (__sec_reduce_min)

Hi,I tried to create an example finding the minimum of values in an array using the __sec_reduce_min()-reducer. However, i got various error messages that i believe point out some bugs. I used the latest version of the cilk-branch (downloaded today, 21:00 EST) only with the flags -lcilkrts and -fcilkplus. I am running a Fedora 16 x86-64. 

using namespace std;

int main(int argc, char** argv) {
        double* A = new double[5]; 
        for (int i = 0; i < 5; i++) A[i] = i;
        __sec_reduce_min(A[0:5]);
        return 0;
        
}

This code produces the following error:test.cpp: In function ‘int main(int, char**)’:test.cpp:18:1: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:2055 } ^test.cpp: In function ‘int main(int, char**)’:test.cpp:18:1: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:2055 } ^If you change the line with the reducer to 

double myvar = __sec_reduce_min(A[0:5]);

The error message becomes: test.cpp: In function ‘int main(int, char**)’:test.cpp:15:1: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:1001 } ^I actually got a third error message in another function. I was trying to build a k-means implementation. Unfortunately, i can't reproduce the error; i used an older version of cilk to compile; now, when i use the latest version, it produces the second error message i wrote. I assume, that the third bug is already fixed. If i find it, i will post it.

5 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Hello Leif,
    I have reproduced the problem. I will get back to you as soon as I fix it.

Thanks,

Balaji V. Iyer.

  1.         double* A = new double[5];   
  2.         for (int i = 0; i < 5; i++) A[i] = i;  
  3.         __sec_reduce_min(A[0:5]); 

Sorry, I still find the notation difficult to remember, particularly with plain C99 or C++ next to CEAN.  In the notations of other languages, you would exceed the array bounds in this reduction.  Of course, in CEAN this means 5 elements, ending with A[4].

Hello Tim,
    I am sorry, but I do not understand how we will exceed array bounds..

A[0:5] implies we start at A[0] and access 5 elements starting at A[0], so in essence, we are trying to find the min of A[0], A[1], A[2], A[3] and A[4].

Thanks,

Balaji V. Iyer. 

Hello Leif,
   I have fixed the problem and checked in a patch to Cilk Plus gcc. Please let me know if you have further issues.

Thanks,

Balaji V. Iyer.

Melden Sie sich an, um einen Kommentar zu hinterlassen.