AnsweredAssumed Answered

Function arguments appear to be ignored.

Question asked by klkblake on Jul 23, 2013
Latest reply on Aug 4, 2014 by pinform

Test case attached, and reproduced below. The last one or two arguments to foo are always zero for some reason, regardless of the number of arguments. The number of valid arguments appears to always be even. Removing the initialisation of the returned struct causes the bug to go away.


typedef struct {
        int bar;
        uint2 baz;
} Foo;

Foo foo_new(int offset, int offset2, int offset3, int offset4, int o5, int o6) {
        Foo foo = {
                .bar = 1,
                .baz = {2, 3},
        printf("Received arguments: %d, %d, %d, %d, %d, %d\n", offset, offset2, offset3, offset4, o5, o6);
        return foo;

__kernel void testcase() {
        for (int i = 0; i < 1000; i++) {
                Foo foo = foo_new(i, i, i, i, i, i);