http://llvm.org/bugs/show_bug.cgi?id=11987

             Bug #: 11987
           Summary: Should static variable roll back it's value when use
                    setjmp()/longjmp() with Clang -O option?
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Created attachment 8045
  --> http://llvm.org/bugs/attachment.cgi?id=8045
compliled with "clang -O jmp_test.c"

jmp_test.c compiled with optimization option "clang -O jmp_test.c"

when run ./a.out, the output is:
-----------------------
in f1():
g, a, r, v, s
91, 92, 93, 94, 95
after long jump:
g, a, r, v, s
91, 2, 3, 94, 5
-----------------------

my question is:

should static variable such as "int static_val" roll back it's
value after longjmp()? it's value should be 95 or 5?


the code is attached below.

thank you.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to