I have segfaults in applications built with CFLAGS="-march=prescott -O2 -mfpmath=sse -ftree-vectorize -pipe" with both gcc-4.1.1-r3 and gcc-4.1.2. The reason of segfaults is buggy code produced by gcc with this CFLAGS, that try to access unaligned memory in movapd(move two ALIGNED packed double-precision values) SSE-instruction. Reproducible: Always Steps to Reproduce: $ emerge --info Portage 2.1.2-r9 (default-linux/x86/2006.1, gcc-4.1.2, glibc-2.5-r0, 2.6.19-gentoo-r5 i686) ================================================================= System uname: 2.6.19-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz Gentoo Base System release 1.12.9 Timestamp of tree: Fri, 02 Mar 2007 01:47:01 +0000 ccache version 2.4 [disabled] dev-java/java-config: 1.3.7, 2.0.31-r3 dev-lang/python: 2.3.5-r3, 2.4.3-r4 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r6 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.61 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.16.1-r3 sys-devel/gcc-config: 1.3.14 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=prescott -O2 -mfpmath=sse -pipe" CHOST="i686-pc-linux-gnu" ...
Created attachment 111878 [details] First case. Broken poppler-0.5.4-r1 code that references unaligned data in movapd produced by gcc-4.1.1-r3
Created attachment 111879 [details] Second Case. Broken librsvg-2.16.1 code that references unaligned data, produced by gcc-4.1.2
we know -ftree-vectorize breaks some things when SSE is involved, but we dont have any reduced testcases
this is sounding a bit like http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25413
Created attachment 126024 [details, diff] gcc-4.2.0-vectorize-pr25413.patch fixed in 4.2.2. here's the patch.
4.3 is stable now, which should have fixed this.