This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Default expansion of builtin_longjmp


The default expansion of builtin_longjmp will use nonlocal_goto if it is
defined by the backend.

Looking at the builtin_longjmp expansion code in builtins.c, I find that
it does not match the documentation for 'nonlocal_goto' in GCC
internals: "the first argument is to be loaded into the frame pointer"

However, the expand_goto() in stmt.c does match the GCC internal
documentation.

Reading the nonlocal_goto expansion i960.md, sparc.md and xtensa.md,
didn't help to clear up the confusion.

i960.md seems to treat the first argument as the frame pointer, whereas
sparc.md & xtensa.md seems to treat the last argument as the frame
pointer.


Snippet from builtins.c:

---
if (HAVE_nonlocal_goto)
/* We have to pass a value to the nonlocal_goto pattern thatwill
   get copied into the static_chain pointer, but it does not matter
   what that value is, because builtin_setjmp does not use it.  */
emit_insn (gen_nonlocal_goto (value, lab, stack, fp));
  else
---





-- 
Øyvind Harboe
http://www.zylin.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]