------- Comment #2 from arnold-j at t-online dot de 2005-11-14 22:55 ------- I am indeed hiding a lot of code, but hopefully in order to pinpoint the issue. This code snippet is taken from the rockbox project http://www.rockbox.org/ , precisely from http://www.rockbox.org/viewcvs.cgi/firmware/system.c?annotate=1.73 Check lines 652-1019.
This is part of the exception handling on the SH1 target CPU. All exceptions are handled in one C handler function, UIE(). However, the only way to get the exception number on SH1 is checking the called handler address, so all exceptions that aren't handled by other code are handled by tiny assembler snippets which just fetch their callee address and pass it to UIE(), which then checks the address it was called from. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24863