https://bugs.llvm.org/show_bug.cgi?id=50234

            Bug ID: 50234
           Summary: [PPC] Value of local variable corrupted with
                    `__builtin_setjmp`
           Product: new-bugs
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

Created attachment 24831
  --> https://bugs.llvm.org/attachment.cgi?id=24831&action=edit
Repro

The attached C program (named ppc_bsjlj.c) behaves incorrectly when compiled
with optimization level -O1 or higher for PPC targets.

For 32-bit PPC

$ clang --target=powerpc-unknown-linux-gnu -O3 -c ppc_bsjlj.c

results in the output

value = 268566576
value = 268566596

where the two lines should be identical.

Similarly, for ppc64le

$ clang --target=powerpc64le-unknown-linux-gnu -O3 -c ppc_bsjlj.c

results in

value = 268566608
value = 268566648

Note that in the program the value of the local variable `n` is not changed
between `__builtin_setjmp` and the corresponding `__builtin_longjmp`. Indeed it
is const-qualified.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to