> From: Paul Schlie <[EMAIL PROTECTED]> >> From: Marek Michalkiewicz <[EMAIL PROTECTED]> >> Good question - I can't. On the other hand, the manual says: >> >> `indirect_jump' >> An instruction to jump to an address which is operand zero. *This pattern >> name is mandatory on all machines.* >> >> Why would it be mandatory if it was not truly needed? If the manual is >> correct, it seems this pattern is truly needed (not just an optional >> optimization like some other patterns). >> >> If it is impossible on the AVR, it could be implemented with invalid >> assembler output (so we get an error if "impossible" ever happens). >> But I'd like to be sure if this is really the case. GCC is not only >> a C compiler, perhaps indirect_jump is needed for some other language? > > - I believe it's simply a vehicle to allow the target describe how to > jump indirectly to an address which may be required if the compiler > chooses to generate a static jump table mapped into presumably the > program's "text" section, therefore would guess the right thing to do > would be to (assuming operand-0 is a progmem reference) load from > progmem 2-words for 256K devices (or 1 word otherwise) into the > appropriate registers, then executes an extended jump instruction > (or regular jump otherwise). > > (as I'd hope the compiler would never map static jump tables that it > chooses to generate into the "data" section, but can't find any > description of under what circumstances it may generate/put them?) > > (again, just my guess)
- or possibly GCC may try to be clever by jumping to no-return attribute function calls?