title: How to tell VC++ optimizer not to merge function bodies?
body: <p>Consider the following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  struct A {};
  
  struct B {};
  
  int func1(A *a, B *b, int c, double *d) {
      int tmp = 0;
      tmp = tmp;
  
      return 1;
  }
  
  int func2(A *a, B *b, int c, double *d) {
      return 1;
  }
  
  int main(int argc, char* argv[]) {
      if (func1 == func2) {
          std::cout &lt;&lt; "equal" &lt;&lt; std::endl;
      } else {
          std::cout &lt;&lt; "not equal" &lt;&lt; std::endl;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>When compiled in Release configuration in VS2013 it prints out “equal”. I have a library that depends on comparison of function addresses. You can imagine that it doesn't work quite alright in Release. Is there a way to prevent this kind of optimization in VC++? Or should I file a bug?</p>