------- Additional Comments From ebotcazou at gcc dot gnu dot org 2005-05-08 10:58 ------- > Then what is the point of the -munaligned-doubles flag? Is this simply > ignored? I understand your point about malloc, but what if we have > casts to buffers that are not mod8-aligned? Isn't that what > -munaligned-doubles is for?
Excerpt from the manual: With `-munaligned-doubles', GCC assumes that doubles have 8 byte alignment only if they are contained in another type, or if they have an absolute address. Otherwise, it assumes they have 4 byte alignment. Specifying this option avoids some rare compatibility problems with code generated by other compilers. It is not the default because it results in a performance loss, especially for floating point code. So -munaligned-doubles cannot do anything for your invalid code and the bus error is to be expected. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21389