title: gcc const and optimization across function calls
body: <p>Consider this code, compiled with <code>gcc</code> and <code>-Ofast</code>:</p>
  
  <pre><code>int f1(const char *p) {
      if (!p[0])
          return 0;
  
      f2(); //not inlined
  
      if (p[0]) { //not optimized out
          //do something
          return 0;
      } else {
          //do something else
          //not optimized out
          return 1;
      }
  }
  </code></pre>
  
  <p>how can I get behavior where the second test and lower branch are optimized out (since <code>p[0]</code> is <code>const</code> and has already been tested)?</p>