http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53900

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-09 
16:18:58 UTC ---
Well, I suggest you instead do

struct Foo
{
  float array[4];
  Foo()
  {
    std::cout << array << "\n";
    // check the object is really aligned
    if (std::ptrdiff_t(array) & std::ptrdiff_t(0xf)) != 0)
      assert (false);
    <...code assuming array is aligned...>
  }
};

and the compiler will figure out that array is aligned in code dominated
by the alignment check.

Reply via email to