tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Stack Overflow question about jmp


From: grischka
Subject: Re: [Tinycc-devel] Stack Overflow question about jmp
Date: Mon, 23 Sep 2013 11:32:08 +0200
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Thomas Preud'homme wrote:
x86_64-asm.h defines 3 kind of jmp instruction, 2 of them being:

ALT(DEF_ASM_OP1(jmp, 0xff, 4, OPC_MODRM, OPT_INDIR))
ALT(DEF_ASM_OP1(jmp, 0xff, 0, OPC_JMP | OPC_WL, OPT_REGW))

so basically the star select between the two. *%eax means indirection so first
kind, %eax means register so second choice.  If gcc treat both syntax as the
same it means one of the two is incorrect.

Hard to say seen tcc's full spectrum of bugs there:
- emits wrong codes, e.g. for "jmp *(%eax)"
- accepts invalid input, e.g. "jmp *%eax"
- inconsistence wrt. optional forms: accepts "jmp %rax" but does
  not accept "jmp (%rax)"

(all for x86-64)

Note that in my case, on x86_64, both syntaxs are refused by gcc, even with
ecx as suggested in the stackoverflow link.

Sure.

I've tried on i386 and as outputs:
"Warning: indirect jmp without `*'" so I guess the second alternative is wrong
and should be removed. Can someone confirm this?

Yes with gcc 4.5.  No with gcc 3.4.

--- grischka




reply via email to

[Prev in Thread] Current Thread [Next in Thread]