llvm-6502/lib
Bill Wendling 5edfbdc963 Okay, bear with me here...
If you have a setjmp/longjmp situation, it's possible for stack slot coloring to
reuse a stack slot before it's really dead. For instance, if we have something
like this:

1:  y = g;
    x = sigsetjmp(env, 0);
    switch (x) {
    case 1:
      /* ... */
      goto run;  
    case 0:
  run:
      do_run(); /* marked as "no return" */
      break;
    case 3:
      if (...) {
        /* ... */
        goto run;
      }
      /* ... */
      break;
    }

2:  g = y;

"y" may be put onto the stack, so the expression "g = y" is relying upon the
fact that the stack slot containing "y" isn't modified between (1) and (2). But
it can be, because of the "no return" calls in there. A longjmp might come back
with 3, modify the stack slot, and then go to case 0. And it's perfectly
acceptable to reuse the stack slot there because there's no CFG flow from case 3
to (2).

The fix is to disable certain optimizations in these situations. Ideally, we'd
disable them for all "returns twice" functions. But we don't support that
attribute. Check for "setjmp" and "sigsetjmp" instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-25 21:44:26 +00:00
..
Analysis Rename variable. add comment. 2010-05-20 20:35:24 +00:00
Archive
AsmParser Add support for thiscall calling convention. 2010-05-16 09:08:45 +00:00
Bitcode
CodeGen Okay, bear with me here... 2010-05-25 21:44:26 +00:00
CompilerDriver Print a space after the colon. 2010-05-20 21:11:37 +00:00
ExecutionEngine improve portability to systems that don't have powf/modf (e.g. solaris 9) 2010-05-15 17:10:24 +00:00
Linker
MC llvm-mc: Use EmitIntValue where possible, which makes the API calls from the AsmParser and CodeGen line up better. 2010-05-23 18:36:38 +00:00
Support Fix __crashreport_info__ declaration. 2010-05-20 23:50:19 +00:00
System Add llvm::sys::RunInterruptHandlers(), which runs the registered SIGINT cleanup 2010-05-08 02:10:34 +00:00
Target Changed the encoding of X86 floating point stack operations where both operands 2010-05-25 20:52:34 +00:00
Transforms DominatorTree.getNode can return null for unreachable blocks. 2010-05-20 22:46:54 +00:00
VMCore Add support for thiscall calling convention. 2010-05-16 09:08:45 +00:00
Makefile