------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-06 19:07 ------- (In reply to comment #4) > Subject: RE: optimized code seg faults due to double load on sparcV9 > > I don't think so. Malloc does not guarantee anything but mod-4 > alignment. You have to use memalign to get something better (at least > on a Sun). I only did the +4 pointer stuff to ensure that the double > would be misaligned mod8, as this is what was happening in my code. As > long as I am on a mod4 boundary for my struct, the -munaligned-doubles > flag should force the handling of doubles as though they are unaligned. > The compiler with no optimization does this. But as soon as you turn on > -O1, it ignores the unaligned-doubles directive.
Again what you said about malloc is not true and has not been true since 1989. The C standard says malloc aligns things the largest alignment required for that machine. In this case doubles are aligned by 8. So your code is invalid. -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21389