Hi.

I recent gcc's makes my C++ code crash. I think I have discovered the reason.
In short, gcc -march=pentium2 works, gcc -march=pentium3 breaks.

a) With pentium3, gcc spits sse instructions for moves, like movaps.
   Sure it should be doing this ? If I build with -mno-sse, my code works
   again. But -msse should only activate/deactivate the use of
   __builtin_movaps() and friends. I am also developing the use of SSE
   for my vector math, so I _need_ -msse. How can I just enable the builtins,
   but prevent gcc to spit its own sse instructions ?

b) Automatic use of SSE would be ok if gcc is sure arguments are aligned,
   or if it uses unaligned moves. But I have seen gcc do things like:

   movups  %xmm0, -120(%ebp)

   Who knows how is that aligned ? Even if stack is 16-byte aligned,
   120 is not a multiple of 16... Changing that to movups and compiling
   the assembler, things work. So obviously it was not aligned.

One other clue: the code only breaks if I use pthreads. Single processor
code works. Perhaps default stack created for threads is not correctly
aligned ? I should try to allocate the stack myself...

Any ideas ? Candidate for gcc bugzilla ?

TIA     

-- 
J.A. Magallon <[EMAIL PROTECTED]>      \                 Software is like sex:
werewolf.able.es                         \           It's better when it's free
Mandrake Linux release 9.2 (Cooker) for i586
Linux 2.4.22-pre9-jam1m (gcc 3.3.1 (Mandrake Linux 9.2 3.3.1-0.7mdk))

Reply via email to