title: Avoid compiler optimization while reading memory
body: <p>I want to check an ECC error in a cell of RAM memory.</p>
  
  <p>In order to check ECC errors, I must read or write this memory. So I have chosen to read the memory's value, but the compiler clean this line because I don't use it in rest of my code.</p>
  
  <p>Is there any way to avoid the optimization without modifying the compiler options.</p>
  
  <p>Find below the sequences:</p>
  
  <pre><code> 1. Clear flags
   2. Read memory &lt;==&gt; Rt_value = (unsigned short *) Address
   3. Check flags
  </code></pre>
  
  <p>Note: I use GHS compiler.</p>