--- a/gcc/config/i386/i386.h 2009-07-11 22:06:26.000000000 +0300 +++ a/gcc/config/i386/i386.h 2009-09-25 13:33:17.000000000 +0300 @@ -682,7 +682,9 @@ enum target_cpu_default need a 16-byte aligned stack, as required by SSE instructions. If STACK_REALIGN_DEFAULT is 1 and PREFERRED_STACK_BOUNDARY_DEFAULT is 128, stacks for all functions may be realigned. */ -#define STACK_REALIGN_DEFAULT 0 +/* FIXME: I have no installed 3DNOW cpu to test */ +#define STACK_REALIGN_DEFAULT \ + (((TARGET_SSE || TARGET_3DNOW) && !TARGET_64BIT) ? 1 : 0) /* Boundary (in *bits*) on which the incoming stack is aligned. */ #define INCOMING_STACK_BOUNDARY ix86_incoming_stack_boundary --- a/gcc/config/i386/t-i386 2008-07-23 13:28:06.000000000 +0300 +++ a/gcc/config/i386/t-i386 2009-09-25 13:35:11.000000000 +0300 @@ -11,3 +11,9 @@ i386-c.o: $(srcdir)/config/i386/i386-c.c $(TM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(FLAGS_H) $(C_COMMON_H) $(GGC_H) \ $(TARGET_H) $(TARGET_DEF_H) $(CPPLIB_H) $(C_PRAGMA_H) $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/i386-c.c + +TARGET_LIBGCC2_CFLAGS += -mno-stackrealign + +# try if segfault to disable sse in gcc libs +#TARGET_LIBGCC2_CFLAGS += -mno-sse -mno-3dnow + --- a/gcc/doc/g++.1 2009-07-22 11:23:37.000000000 +0300 +++ a/gcc/doc/g++.1 2009-09-24 22:52:19.000000000 +0300 @@ -10346,6 +10346,7 @@ runtime stack if necessary. This suppor a 4\-byte aligned stack with modern codes that keep a 16\-byte stack for \&\s-1SSE\s0 compatibility. See also the attribute \f(CW\*(C`force_align_arg_pointer\*(C'\fR, applicable to individual functions. +It is enabled by default at SSE on 32bit. .IP "\fB\-mpreferred\-stack\-boundary=\fR\fInum\fR" 4 .IX Item "-mpreferred-stack-boundary=num" Attempt to keep the stack boundary aligned to a 2 raised to \fInum\fR --- a/gcc/doc/gcc.1 2009-07-22 10:53:09.000000000 +0300 +++ a/gcc/doc/gcc.1 2009-09-24 22:52:19.000000000 +0300 @@ -10346,6 +10346,7 @@ runtime stack if necessary. This suppor a 4\-byte aligned stack with modern codes that keep a 16\-byte stack for \&\s-1SSE\s0 compatibility. See also the attribute \f(CW\*(C`force_align_arg_pointer\*(C'\fR, applicable to individual functions. +It is enabled by default at SSE on 32bit. .IP "\fB\-mpreferred\-stack\-boundary=\fR\fInum\fR" 4 .IX Item "-mpreferred-stack-boundary=num" Attempt to keep the stack boundary aligned to a 2 raised to \fInum\fR