Bug when using elemental functions and chars

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:

__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[i] = compare(a[i], b[i]);
        cout << c[i];
    }
    return 0;
}

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

publicaciones de 2 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

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.

Inicie sesión para dejar un comentario.