public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8
@ 2015-03-17  9:37 ubizjak at gmail dot com
  2015-03-17  9:38 ` [Bug fortran/65450] " ubizjak at gmail dot com
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: ubizjak at gmail dot com @ 2015-03-17  9:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65450

            Bug ID: 65450
           Summary: [5.0 Regression]: Unaligned access with -O3 -mtune=k8
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ubizjak at gmail dot com

The compiler generates unaligned access for Polyhedron channel.f90 test when
compiled with -O2 -mtune=k8:

/home/uros/gcc-build/gcc/gfortran -B/home/uros/gcc-build/gcc
-B/home/uros/gcc-build/x86_64-unknown-linux-gnu/libgfortran/ 
-B/home/uros/gcc-build/x86_64-unknown-linux-gnu/libquadmath/.libs
-L/home/uros/gcc-build/x86_64-unknown-linux-gnu/libgfortran/.libs
-L-L/home/uros/gcc-build/x86_64-unknown-linux-gnu/libquadmath/.libs -O2
-ffast-math -mtune=k8 channel.f90

LD_LIBRARY_PATH=/home/uros/gcc-build/gcc:/home/uros/gcc-build/x86_64-unknown-linux-gnu/libgfortran/.libs:/home/uros/gcc-build/x86_64-unknown-linux-gnu/libquadmath/.libs
./a.out

...
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x2AC9058B3C27
#1  0x2AC9058B2E20
#2  0x31CDC3002F
#3  0x402AFB in ddx at channel.f90:247
Segmentation fault

(gdb) r
...
Program received signal SIGSEGV, Segmentation fault.
0x0000000000402afb in ddx (array=..., __result=...) at channel.f90:247
247         ddx(2:I-1,1:J) = array(3:I,1:J)-array(1:I-2,1:J)    ! interior
points

(gdb) bt
#0  0x0000000000402afb in ddx (array=..., __result=...) at channel.f90:247
#1  sw () at channel.f90:148
#2  0x0000000000404cfd in main (argc=<optimized out>, argv=<optimized out>) at
channel.f90:234
#3  0x00000031cdc1d9f4 in __libc_start_main () from /lib64/libc.so.6
#4  0x0000000000400909 in _start ()

(gdb) disass
   ...
   0x0000000000402acc <+7644>:  movaps %xmm4,-0x20(%rdx)
   0x0000000000402ad0 <+7648>:  movlpd -0x10(%rax),%xmm0
   0x0000000000402ad5 <+7653>:  movhpd -0x8(%rax),%xmm0
   0x0000000000402ada <+7658>:  movapd %xmm0,%xmm4
   0x0000000000402ade <+7662>:  subpd  %xmm3,%xmm4
   0x0000000000402ae2 <+7666>:  movaps %xmm4,-0x10(%rdx)
   0x0000000000402ae6 <+7670>:  cmp    $0xf4,%rdi
   0x0000000000402aed <+7677>:  jne    0x402a71 <sw+7553>
   0x0000000000402aef <+7679>:  lea    0x20(%rcx),%rdi
   0x0000000000402af3 <+7683>:  add    $0x20,%rax
   0x0000000000402af7 <+7687>:  add    $0x20,%rdx
=> 0x0000000000402afb <+7691>:  movapd -0x20(%rax),%xmm3
   0x0000000000402b00 <+7696>:  mov    $0xf6,%r11d
   0x0000000000402b06 <+7702>:  xor    %ecx,%ecx
   0x0000000000402b08 <+7704>:  movapd %xmm3,%xmm4
   0x0000000000402b0c <+7708>:  subpd  %xmm0,%xmm4
   ...

(gdb) p/x $rax
$3 = 0x8c5a38

The failure can also be seen on SUSE gcc tester [1].

[1] http://gcc.opensuse.org/c++bench/polyhedron/polyhedron-performance-latest


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2015-06-03 21:43 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
2015-03-17  9:38 ` [Bug fortran/65450] " ubizjak at gmail dot com
2015-03-17 10:00 ` ubizjak at gmail dot com
2015-03-17 10:14 ` dominiq at lps dot ens.fr
2015-03-17 10:22 ` ubizjak at gmail dot com
2015-03-17 10:39 ` jakub at gcc dot gnu.org
2015-03-17 12:42 ` trippels at gcc dot gnu.org
2015-03-17 12:44 ` trippels at gcc dot gnu.org
2015-03-17 12:57 ` dominiq at lps dot ens.fr
2015-03-17 13:24 ` jakub at gcc dot gnu.org
2015-03-17 14:15 ` [Bug fortran/65450] [4.9 5.0 " ubizjak at gmail dot com
2015-03-17 18:06 ` [Bug fortran/65450] [4.9/5 " jakub at gcc dot gnu.org
2015-03-17 21:29 ` jakub at gcc dot gnu.org
2015-03-18  9:00 ` jakub at gcc dot gnu.org
2015-03-18 10:49 ` [Bug tree-optimization/65450] " jakub at gcc dot gnu.org
2015-03-18 11:33 ` rguenth at gcc dot gnu.org
2015-03-18 13:29 ` rguenth at gcc dot gnu.org
2015-03-18 13:54 ` jakub at gcc dot gnu.org
2015-03-18 13:56 ` [Bug tree-optimization/65450] [4.9 " jakub at gcc dot gnu.org
2015-06-03 15:28 ` jakub at gcc dot gnu.org
2015-06-03 21:43 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).