fork download
  1. struct A
  2. {
  3. volatile int a_;
  4. };
  5.  
  6. int main()
  7. {
  8. A* a = new A;
  9. a->a_ = 10;
  10. volatile int i1 = 0, i2 = 0;
  11. asm("LABEL_1:":::);
  12. i1 = (*a).a_;
  13. asm("LABEL_2:":::);
  14. i2 = a->a_;
  15. asm("LABEL_3:":::);
  16. return 0;
  17. }
  18.  
  19. /*
  20. $ g++ --std=c++11 -S -O3 deref.cpp
  21.  
  22.   LABEL_1:
  23. # 0 "" 2
  24. #NO_APP
  25. movl (%rax), %edx
  26. movl %edx, 8(%rsp)
  27. #APP
  28. # 13 "deref.cpp" 1
  29. LABEL_2:
  30. # 0 "" 2
  31. #NO_APP
  32. movl (%rax), %eax
  33. movl %eax, 12(%rsp)
  34. #APP
  35. # 15 "deref.cpp" 1
  36. LABEL_3:
  37.  
  38. */
Success #stdin #stdout 0s 3024KB
stdin
Standard input is empty
stdout
Standard output is empty