gcc 3.2.3 x64 negative indexes

Jakub Jelinek jakub@redhat.com
Wed Feb 7 15:12:37 GMT 2024


On Wed, Feb 07, 2024 at 11:02:51PM +0800, Paul Edwards via Gcc wrote:
> I am using a slightly modified gcc 3.2.3 for x86_64 and for this code:

Don't, gcc 3.2.3 is not supported for more than 20 years already.

> int fff(char *x)
> {
> return (x[-1]);
> }
> 
> 
> It is generating:
> 
> .globl fff
> fff:
> .LFB2:
>         movl    $4294967295, %eax
>         movsbl  (%rax,%rcx),%eax

That said, I can't reproduce it and get
	movsbl	-1(%rdi),%eax
	ret
from 3.2.3.

	Jakub



More information about the Gcc mailing list