The parentheses look a little strange to me; maybe try something like below? Also, declaring all variables first (at function scope) usually helps the compiler, a lot.
void dump(tensor *t, int asfloat) {
uint8_t d;
for (int j = 0; j < t->data_len; j++) {
d = (uint8_t) ((t->data)[j]);
printf("%x, ", d);
}
}
You may also want to check the .lst file output to see exactly what is the code being generated; if not as desired, there might be a compiler option or optimization level that could help.
Nothing here nas anything to do with privilege level though, which is good.