http://llvm.org/bugs/show_bug.cgi?id=11468
Alexey Samsonov <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID | --- Comment #4 from Alexey Samsonov <[email protected]> 2011-12-02 15:14:08 CST --- Ouch, sorry for that. I tried to make another reproducer, please take a look: $ cat exception_test.cc #include <stdio.h> __attribute__((noinline)) void TouchR15AndThrow(const char& arg) { volatile int n __attribute__((aligned(32))) = 0; asm volatile ("nop" : : : "%r15"); // force to save r15 on stack throw arg; } int main() { // Set r15 value int a = 42; asm ("movq %0, %%r15;\n\t" : : "g"(a) : "%r15"); // Output value of r15 int b; asm ("movq %%r15, %0;\n\t" : "=g" (b) : : "%r15"); fprintf(stderr, "before = %d\n", b); try { TouchR15AndThrow('c'); } catch (const char&) { } // Output value of r15 again asm ("movq %%r15, %0;\n\t" : "=g" (b) : : "%r15"); fprintf(stderr, "after = %d\n", b); return 0; } $ ../build/Release+Asserts/bin/clang++ -O2 exception_test.cc $ ./a.out before = 42 after = 0 there is no instruction that changes value in %r15, but it is incorrectly restored after exception is caught. -- 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
