This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/14776] -mfpmath=sse causes movapd from non-16-byte aligned address


------- Additional Comments From ps dot report at gmx dot net  2004-07-06 12:16 -------
The previous attached example programm compiled with gcc-3.4.1 gives
a Segmentation fault too (the same with 3.4.0 and gcc-3.4.1-20040625, not
with gcc-3.3.3).

This happens because of a missaligned 'movapd %xmm0,0xffffff88(%ebp)'.

Reading specs from /opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/specs
Configured with: ../gcc-3.4.1/configure --prefix=/opt/gcc-3.4.1
--enable-threads=posix --enable-languages=c,c++,java
Thread model: posix
gcc version 3.4.1
 /opt/gcc-3.4.1/libexec/gcc/i686-pc-linux-gnu/3.4.1/cc1 -E -quiet -v
-D_REENTRANT movapd_align_bug_pthread.c -march=pentium4 -Wall
-fworking-directory -O2 -o movapd_align_bug_pthread.i
ignoring nonexistent directory
"/opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /opt/gcc-3.4.1/include
 /opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/include
 /usr/include
End of search list.
 /opt/gcc-3.4.1/libexec/gcc/i686-pc-linux-gnu/3.4.1/cc1 -fpreprocessed
movapd_align_bug_pthread.i -quiet -dumpbase movapd_align_bug_pthread.c
-march=pentium4 -auxbase movapd_align_bug_pthread -g -O2 -Wall -version -o
movapd_align_bug_pthread.s
GNU C version 3.4.1 (i686-pc-linux-gnu)
	compiled by GNU C version 3.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 as -V -Qy -o movapd_align_bug_pthread.o movapd_align_bug_pthread.s
GNU assembler version 2.13.90.0.18 (i486-suse-linux) using BFD version
2.13.90.0.18 20030121 (SuSE Linux)
 /opt/gcc-3.4.1/libexec/gcc/i686-pc-linux-gnu/3.4.1/collect2 --eh-frame-hdr -m
elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o
/opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/crtbegin.o
-L/opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1
-L/opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/../../..
movapd_align_bug_pthread.o -lm -lgcc -lgcc_eh -lpthread -lc -lgcc -lgcc_eh
/opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/crtend.o /usr/lib/crtn.o
GNU gdb 6.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library
"/lib/libthread_db.so.1".

(gdb) run
Starting program: /home/seiderer/test/gcc_bug_14776/a.out 
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 11430)]
[New Thread 32769 (LWP 11432)]
[New Thread 16386 (LWP 11433)]
[New Thread 32771 (LWP 11434)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16386 (LWP 11433)]
create_geo_to_topo (xfp=0xbf7ffa6c, lat=1, lon=1)
    at movapd_align_bug_pthread.c:41
41		xfp->m[0].x = -sin_lon;
(gdb) info reg
eax            0xbf7ff9fc	-1082131972
ecx            0x401b7d60	1075543392
edx            0x6	6
ebx            0xbf7ffa6c	-1082131860
esp            0xbf7ff9bc	0xbf7ff9bc
ebp            0xbf7ffa44	0xbf7ffa44
esi            0xbf7ffbe0	-1082131488
edi            0x0	0
eip            0x8048541	0x8048541
eflags         0x10246	66118
cs             0x23	35
ss             0x2b	43
ds             0x2b	43
es             0x2b	43
fs             0x0	0
gs             0x0	0
(gdb) disassemble 
Dump of assembler code for function create_geo_to_topo:
0x0804848f <create_geo_to_topo+0>:	push   %ebp
0x08048490 <create_geo_to_topo+1>:	mov    %esp,%ebp
0x08048492 <create_geo_to_topo+3>:	push   %ebx
0x08048493 <create_geo_to_topo+4>:	sub    $0x84,%esp
0x08048499 <create_geo_to_topo+10>:	fldl   0x14(%ebp)
0x0804849c <create_geo_to_topo+13>:	mov    0x8(%ebp),%ebx
0x0804849f <create_geo_to_topo+16>:	fstpl  (%esp)
0x080484a2 <create_geo_to_topo+19>:	call   0x80483ac <sin>
0x080484a7 <create_geo_to_topo+24>:	fldl   0x14(%ebp)
0x080484aa <create_geo_to_topo+27>:	fstpl  (%esp)
0x080484ad <create_geo_to_topo+30>:	fstpl  0xffffffb0(%ebp)
0x080484b0 <create_geo_to_topo+33>:	call   0x804836c <cos>
0x080484b5 <create_geo_to_topo+38>:	fstpl  0xffffffa8(%ebp)
0x080484b8 <create_geo_to_topo+41>:	fldl   0xc(%ebp)
0x080484bb <create_geo_to_topo+44>:	fstpl  (%esp)
0x080484be <create_geo_to_topo+47>:	call   0x80483ac <sin>
0x080484c3 <create_geo_to_topo+52>:	fldl   0xc(%ebp)
0x080484c6 <create_geo_to_topo+55>:	fstpl  (%esp)
0x080484c9 <create_geo_to_topo+58>:	fstpl  0xffffffa0(%ebp)
0x080484cc <create_geo_to_topo+61>:	call   0x804836c <cos>
0x080484d1 <create_geo_to_topo+66>:	fldl   0xffffffa8(%ebp)
0x080484d4 <create_geo_to_topo+69>:	fldl   0xffffffb0(%ebp)
0x080484d7 <create_geo_to_topo+72>:	fxch   %st(1)
0x080484d9 <create_geo_to_topo+74>:	fstl   0x18(%ebx)
0x080484dc <create_geo_to_topo+77>:	fchs   
0x080484de <create_geo_to_topo+79>:	fxch   %st(1)
0x080484e0 <create_geo_to_topo+81>:	fchs   
0x080484e2 <create_geo_to_topo+83>:	fxch   %st(1)
0x080484e4 <create_geo_to_topo+85>:	fmull  0xffffffa0(%ebp)
0x080484e7 <create_geo_to_topo+88>:	fxch   %st(1)
0x080484e9 <create_geo_to_topo+90>:	fstl   (%ebx)
0x080484eb <create_geo_to_topo+92>:	fxch   %st(2)
0x080484ed <create_geo_to_topo+94>:	fstl   0x38(%ebx)
0x080484f0 <create_geo_to_topo+97>:	fxch   %st(1)
0x080484f2 <create_geo_to_topo+99>:	fstpl  0x8(%ebx)
0x080484f5 <create_geo_to_topo+102>:	fldl   0xffffffa8(%ebp)
0x080484f8 <create_geo_to_topo+105>:	fldz   
0x080484fa <create_geo_to_topo+107>:	fxch   %st(1)
0x080484fc <create_geo_to_topo+109>:	fmul   %st(2),%st
0x080484fe <create_geo_to_topo+111>:	fxch   %st(3)
0x08048500 <create_geo_to_topo+113>:	fmull  0xffffffa0(%ebp)
0x08048503 <create_geo_to_topo+116>:	fxch   %st(3)
0x08048505 <create_geo_to_topo+118>:	lea    0xffffffd8(%ebp),%eax
0x08048508 <create_geo_to_topo+121>:	fstpl  0x10(%ebx)
0x0804850b <create_geo_to_topo+124>:	fldl   0xffffffb0(%ebp)
0x0804850e <create_geo_to_topo+127>:	fxch   %st(1)
0x08048510 <create_geo_to_topo+129>:	fstl   0x30(%ebx)
0x08048513 <create_geo_to_topo+132>:	fxch   %st(1)
0x08048515 <create_geo_to_topo+134>:	fmulp  %st,%st(2)
0x08048517 <create_geo_to_topo+136>:	fldl   0xffffffa0(%ebp)
0x0804851a <create_geo_to_topo+139>:	fxch   %st(3)
0x0804851c <create_geo_to_topo+141>:	fstpl  0x20(%ebx)
0x0804851f <create_geo_to_topo+144>:	fxch   %st(1)
0x08048521 <create_geo_to_topo+146>:	fstpl  0x28(%ebx)
0x08048524 <create_geo_to_topo+149>:	fxch   %st(1)
0x08048526 <create_geo_to_topo+151>:	fstpl  0x40(%ebx)
0x08048529 <create_geo_to_topo+154>:	fldl   0xc(%ebp)
0x0804852c <create_geo_to_topo+157>:	fldl   0x14(%ebp)
0x0804852f <create_geo_to_topo+160>:	mov    %eax,0x4(%esp)
0x08048533 <create_geo_to_topo+164>:	movsd  0x80486c0,%xmm0
0x0804853b <create_geo_to_topo+172>:	lea    0xffffffb8(%ebp),%eax
0x0804853e <create_geo_to_topo+175>:	fstpl  0xffffffc0(%ebp)
0x08048541 <create_geo_to_topo+178>:	movapd %xmm0,0xffffff88(%ebp)
0x08048546 <create_geo_to_topo+183>:	fstpl  0xffffffb8(%ebp)
0x08048549 <create_geo_to_topo+186>:	fstpl  0xffffffc8(%ebp)
0x0804854c <create_geo_to_topo+189>:	mov    %eax,(%esp)
0x0804854f <create_geo_to_topo+192>:	call   0x8048474 <geo_lla_xyz>
0x08048554 <create_geo_to_topo+197>:	fldl   0xffffffd8(%ebp)
0x08048557 <create_geo_to_topo+200>:	fchs   
0x08048559 <create_geo_to_topo+202>:	fstpl  0x48(%ebx)
0x0804855c <create_geo_to_topo+205>:	add    $0x84,%esp
0x08048562 <create_geo_to_topo+211>:	pop    %ebx
0x08048563 <create_geo_to_topo+212>:	pop    %ebp
0x08048564 <create_geo_to_topo+213>:	ret    
End of assembler dump.
(gdb) quit
The program is running.  Exit anyway? (y or n) 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ps dot report at gmx dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14776


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]