[Bug c++/15795] No way to teach operator new anything about alignment requirements

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Thu Jun 3 17:39:00 GMT 2004


------- Additional Comments From bangerth at dealii dot org  2004-06-03 17:39 -------
Oh, I should have said that indeed on my system, the memory location 
is 8-byte aligned, not 16-byte aligned. If I do make it 16-byte 
aligned, for example with a hack like this 
  char *p = new char[10000]; 
  __m128 * foo = (__m128*)(((int)(p+16))/16*16); 
(for which I have no idea whether it is in accordance with aliasing rules), 
then the program correctly succeeds. Nevertheless, I believe that gcc 
should have some way of transmitting alignment requirements when it allocated 
memory. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Strange bug / incorrect code|No way to teach operator new
                   |generation with SSE         |anything about alignment
                   |                            |requirements


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



More information about the Gcc-bugs mailing list