title: GCC changing signdess whole expression
body: <p>I have the following code:</p>
  <pre><code>unsigned int m_font_timer = 0;
  
  int Getsum(int p_top_left_x)
  {
      int l_sum = (((p_top_left_x + (m_font_timer &gt;&gt; 2)) &amp; 0x7) - 4 ) &gt;&gt; 2;
      
      if (l_sum &lt; 0) l_sum = -l_sum;
      return l_sum;
  }
  </code></pre>
  <p>Unless I explicitly cast <strong>m_font_timer</strong> to (signed int) this part of the expression becomes unsigned:</p>
  <pre><code>((p_top_left_x + (m_font_timer &gt;&gt; 2)) &amp; 0x7) - 4 );
  </code></pre>
  <p>Even though there is a &quot;-4&quot; and p_top_left_x is signed.</p>
  <p>This is happening on a crosscompiler for SH4 using gcc 4.7.3 (I'm programming for an old system that requires it).
  I wasn't expecting that part to turn into unsigned. I have this code running on two other platforms also with GCC (higher version than this one) and one with MSCV and they all keep the aforementioned expression as signed.</p>
  <p>I don't know much about compilers, is this undefined behavior?
  Is there any way the compiler would warn me about this? I have <em><strong>-Wall -Wformat=0 -Wextra -Wsign-compare</strong></em> but doesn't rise any warnings in that function.</p>
  <p>Thanks!</p>