title: How to tell GCC that a pointer argument is always double-word-aligned?
body: <p>In my program I have a function that does a simple vector addition <code>c[0:15] = a[0:15] + b[0:15]</code>. The function prototype is:</p>
  
  <pre><code>void vecadd(float * restrict a, float * restrict b, float * restrict c);
  </code></pre>
  
  <p>On our 32-bit embedded architecture there is a load/store option of loading/storing double words, like:</p>
  
  <pre><code>r16 = 0x4000  ;
  strd r0,[r16] ; stores r0 in [0x4000] and r1 in [0x4004]
  </code></pre>
  
  <p>The GCC optimizer recognizes the vector nature of the loop and generates two branches of the code - one for the case where the 3 arrays are double word aligned (so it uses the double load/store instructions) and the other for the case that the arrays are word-aligned (where it uses the single load/store option).</p>
  
  <p>The problem is that the address alignment check is costly relative to the addition part and I want to eliminate it by hinting the compiler that a, b and c are always 8-aligned. Is there a modifier to add to the pointer declaration to tell this to the compiler?</p>
  
  <p>The arrays that are used for calling this function have the aligned(8) attribute, but it is not reflected in the function code itself. is it possible to add this attribute to the function parameters?</p>