Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
26 Views

Bug when using elemental functions and chars

Hi,

 i have a small program using an elemental function to compute the edit distance of two strings:

[cpp]

__attribute__((vector))
int compare(char x, char y) {
    if (x == y) {
        return(1);
    } else {
        return(0);
    }
}
int main()
{
    char a[3] = {'A','A','A'};
    char b[3] = {'A','A','A'};
    int c[3];
    for (int i = 0; i < 3; i++) {
        c = compare(a, b);
        cout << c;
    }
    return 0;
}

[/cpp]

When compiling, i receive the following error message:

test.cpp: In function ‘__vector(4) int compare._simdsimd_B4m_v1(char, char)’:
test.cpp:9:5: internal compiler error: in convert_move, at expr.c:353
int compare(char x, char y) {
     ^

This does not happen, if i use an array of integers instead of chars.

I use the latest version of the gcc cilkplus-branch (checked out today).

regards

0 Kudos
1 Reply
Highlighted
New Contributor II
26 Views

hello, with Intel composer XE 2013 which also has Cilk, this issue does not come. which compiler did you check with? I am not sure we can do anthing with gcc cilkplus branch. though if you need more clarification, you can send the details for analysis.
0 Kudos