Hi.

I am using a slightly modified gcc 3.2.3 for x86_64 and for this code:

int fff(char *x)
{
return (x[-1]);
}


It is generating:

.globl fff
fff:
.LFB2:
        movl    $4294967295, %eax
        movsbl  (%rax,%rcx),%eax
        ret


My understanding is that that move of -1 into eax
does NOT sign-extend, and thus results in a very
high index, which causes a crash.

I may have stuffed something up myself.

Anyone know which code governs this behavior?

Thanks. Paul.

Reply via email to