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

* [Bug fortran/65450] [5.0 Regression]: Unaligned access with -O3 -mtune=k8
  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 ` ubizjak at gmail dot com
  2015-03-17 10:00 ` ubizjak at gmail dot com
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ubizjak at gmail dot com @ 2015-03-17  9:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 35042
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35042&action=edit
Testcase from Polyhedron testsuite
>From gcc-bugs-return-480524-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Mar 17 09:39:16 2015
Return-Path: <gcc-bugs-return-480524-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 92599 invoked by alias); 17 Mar 2015 09:39:16 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 92566 invoked by uid 48); 17 Mar 2015 09:39:12 -0000
From: "radventure at yandex dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/65312] Implicitly-declared default constructor must be defined as deleted
Date: Tue, 17 Mar 2015 09:39:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: radventure at yandex dot ru
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65312-4-vP7DojRlTn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65312-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65312-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg01668.txt.bz2
Content-length: 209

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide312

--- Comment #5 from radventure at yandex dot ru ---
(In reply to Marek Polacek from comment #4)
> Looks like this PR could be resolved as a NOTABUG?

Agree


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

* [Bug fortran/65450] [5.0 Regression]: Unaligned access with -O3 -mtune=k8
  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
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ubizjak at gmail dot com @ 2015-03-17 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
The problematic instruction (insn 1717) is generated from:

;; vect__1095.501_3524 = MEM[base: vectp.499_3571, offset: 0B];

(insn 1717 1716 0 (set (reg:V2DF 1511 [ vect__1095.501 ])
        (mem:V2DF (reg/f:DI 638 [ vectp.499 ]) [7 MEM[base: vectp.499_3571,
offset: 0B]+0 S16 A256])) channel.f90:247 -1
     (nil))
>From gcc-bugs-return-480527-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Mar 17 10:07:34 2015
Return-Path: <gcc-bugs-return-480527-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 42855 invoked by alias); 17 Mar 2015 10:07:34 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 42760 invoked by uid 48); 17 Mar 2015 10:07:30 -0000
From: "ktkachov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/65358] wrong parameter passing code with tail call optimization on arm
Date: Tue, 17 Mar 2015 10:07:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.6.3
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: critical
X-Bugzilla-Who: ktkachov at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65358-4-vyDrfuTAJ8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65358-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65358-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg01671.txt.bz2
Content-length: 1133

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide358

--- Comment #14 from ktkachov at gcc dot gnu.org ---
Right, I think the root cause is the emit_push_insn in expr.c.
It's supposed to push what needs to be pushed from a partial argument onto the
stack and do the moves into the registers.
Currently it performs the pushes and then does the moves, which does the wrong
things if the pushing destroys stack elements that it wants to load into
registers. Doing the load-to-registers part first and the pushing second fixed
this for me and generated the below:
foo:
        @ args = 16, pretend = 8, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        sub     sp, sp, #8
        mov     r0, r1
        mov     r1, r2
        str     lr, [sp, #-4]!
        ldr     lr, [sp, #16]
        mov     ip, sp
        str     r3, [ip, #8]!
        ldmia   ip, {r2, r3}
        str     lr, [sp, #12]
        ldr     lr, [sp], #4
        add     sp, sp, #8
        b       bar


which still does the tail call optimisation. I haven't tested it more
extensively yet, so I'll be taking that approach and prepare and test a patch.


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

* [Bug fortran/65450] [5.0 Regression]: Unaligned access with -O3 -mtune=k8
  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
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-03-17 10:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed between r220156 (2015-01-27, OK) and r220302 (2015-01-31, segfault).
I am not sure this is a fortran problem (no segfault if the code is compiled
with '-O3 -fno-tree-vectorize -mtune=k8').


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

* [Bug fortran/65450] [5.0 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (2 preceding siblings ...)
  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
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ubizjak at gmail dot com @ 2015-03-17 10:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #0)
> The compiler generates unaligned access for Polyhedron channel.f90 test when
> compiled with -O2 -mtune=k8:

Whoops, this should read "-O3 -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

And here. Correct flags are "-O3 -mtune=k8".  Everything reported is compiled
with these two flags only.
>From gcc-bugs-return-480530-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Mar 17 10:25:41 2015
Return-Path: <gcc-bugs-return-480530-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 53980 invoked by alias); 17 Mar 2015 10:25:41 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 53961 invoked by uid 48); 17 Mar 2015 10:25:38 -0000
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/65450] [5.0 Regression]: Unaligned access with -O3 -mtune=k8
Date: Tue, 17 Mar 2015 10:25:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dominiq at lps dot ens.fr
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-65450-4-WMqTkSvUkg@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65450-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65450-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg01674.txt.bz2
Content-length: 508

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide450

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-17
     Ever confirmed|0                           |1

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed: see comment 3.


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

* [Bug fortran/65450] [5.0 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (3 preceding siblings ...)
  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
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-17 10:39 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Most likely r220244, but have to verify that.


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

* [Bug fortran/65450] [5.0 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (4 preceding siblings ...)
  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
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-17 12:42 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |trippels at gcc dot gnu.org

--- Comment #7 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Also crashes with -mtune=amdfam10. But in this case it even
crashes when compiled with 4.9.2.


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

* [Bug fortran/65450] [5.0 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (5 preceding siblings ...)
  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
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-17 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Works fine with -fwrapv...


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

* [Bug fortran/65450] [5.0 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (6 preceding siblings ...)
  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
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-03-17 12:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Also crashes with -mtune=amdfam10. But in this case it even
> crashes when compiled with 4.9.2.

Revision r204000 (2013-10-24) is OK, r204945 (2013-11-18) is not.

> Works fine with -fwrapv...

Confirmed.


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

* [Bug fortran/65450] [5.0 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (7 preceding siblings ...)
  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
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-17 13:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #9)
> > Also crashes with -mtune=amdfam10. But in this case it even
> > crashes when compiled with 4.9.2.
> 
> Revision r204000 (2013-10-24) is OK, r204945 (2013-11-18) is not.
> 
> > Works fine with -fwrapv...
> 
> Confirmed.

r204257 in particular.


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

* [Bug fortran/65450] [4.9 5.0 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (8 preceding siblings ...)
  2015-03-17 13:24 ` jakub at gcc dot gnu.org
@ 2015-03-17 14:15 ` ubizjak at gmail dot com
  2015-03-17 18:06 ` [Bug fortran/65450] [4.9/5 " jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ubizjak at gmail dot com @ 2015-03-17 14:15 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.3
            Summary|[5.0 Regression]: Unaligned |[4.9 5.0 Regression]:
                   |access with -O3 -mtune=k8   |Unaligned access with -O3
                   |                            |-mtune=k8

--- Comment #11 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Dominique d'Humieres from comment #9)
> > Also crashes with -mtune=amdfam10. But in this case it even
> > crashes when compiled with 4.9.2.
> 
> Revision r204000 (2013-10-24) is OK, r204945 (2013-11-18) is not.

Probably the cause of failure for "channel" testcase at SUSE's amdfam10 tester
[1], but nobody noticed.

[1]
http://gcc.opensuse.org/c++bench-frescobaldi/polyhedron/polyhedron-summary.txt-2-0.html
>From gcc-bugs-return-480546-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Mar 17 14:29:09 2015
Return-Path: <gcc-bugs-return-480546-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 53467 invoked by alias); 17 Mar 2015 14:29:09 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 53433 invoked by uid 48); 17 Mar 2015 14:29:05 -0000
From: "gnugcc at marino dot st" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/65451] gnat bug: Storage_Error stack overflow or erroneous memory access
Date: Tue, 17 Mar 2015 14:29:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: ada
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: gnugcc at marino dot st
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65451-4-P8TNgAaEBm@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65451-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65451-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg01690.txt.bz2
Content-length: 183

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide451

--- Comment #2 from John Marino <gnugcc at marino dot st> ---
right url for freshports: http://www.freshports.org/devel/matreshka


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

* [Bug fortran/65450] [4.9/5 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (9 preceding siblings ...)
  2015-03-17 14:15 ` [Bug fortran/65450] [4.9 5.0 " ubizjak at gmail dot com
@ 2015-03-17 18:06 ` jakub at gcc dot gnu.org
  2015-03-17 21:29 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-17 18:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, I believe it is incorrect ALIGN info as can be seen in the
-fdump-tree-all-alias dumps.
Seems with current trunk on x86_64-linux and
-g -quiet -mtune=amdfam10 -O3 pr65450.f90
the problematic memory load which should have been movupd and is movapd instead
is using _3571:
  # ALIGN = 32, MISALIGN = 0
  vectp.499_3571 = vectp.499_1481 + 64;
which has been created by aprefetch pass from:
  # ALIGN = 32, MISALIGN = 0
  vectp.499_135 = vectp.499_1480 + 16;
which has been created by pcom pass from:
  # ALIGN = 32, MISALIGN = 0
  vectp.499_1480 = vectp.499_1481 + 16;
which has been created during vectorization by vect_create_data_ref_ptr ->
create_iv -> make_ssa_name for dr:
#(Data Ref: 
#  bb: 43 
#  stmt: _1095 = MEM[(real(kind=8)[0:D.3649] *)_558][_1094];
#  ref: MEM[(real(kind=8)[0:D.3649] *)_558][_1094];
#  base_object: MEM[(real(kind=8)[0:D.3649] *)_558];
#  Access function 0: {_1086 + 3, +, 1}_41
#)
- _1480 is indx_after_incr.
The base_object is indeed 32 byte aligned:
  # RANGE [-64424509440000, 60000] NONZERO 18446744073709551600
  _557 = _556 * 30000;
  # PT = { D.3692 } (nonlocal)
  # ALIGN = 32, MISALIGN = 0
  _558 = &u[_557];
- u is a common aligned to 32 bytes:
static real(kind=8) u[90000];
and 30000 is divisible by 16, and it is ARRAY_REF, so the offset from &u[0] is
a multiple of 128 bytes.  But that doesn't tell anything about what values
_1094 can have.
I see vect_create_addr_base_for_vector_ref already always overrides the
align/misalign info after duplicating DR_PTR_INFO, and so does bump_vector_ptr,
but vect_create_data_ref_ptr trusts DR_PTR_INFO.  But from what I can
understand, it is just the points to info, and alignment info in there is
solely for the base address, but not necessarily for the whole DR.
Richard, do you agree?  Now the question is what we can do here, if in all the
spots in vect_create_data_ref_ptr we should just set it to unknown alignment,
or if we can do better (and how).


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

* [Bug fortran/65450] [4.9/5 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (10 preceding siblings ...)
  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
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-17 21:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 35047
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35047&action=edit
gcc5-pr65450.patch

Fix that passed bootstrap/regtest on x86_64-linux and i686-linux.  It is I
think conservatively correct, on the other side we don't have any ccp pass
after vectorization that could recompute that info, only vrp2 which doesn't do
zero bits computation, so perhaps we should try harder.


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

* [Bug fortran/65450] [4.9/5 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (11 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-18  9:00 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35047|0                           |1
        is obsolete|                            |

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 35053
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35053&action=edit
gcc5-pr65450.patch

Updated (but this time untested except on the testcase) patch, that tries to
preserve the alignment info in DR_PTR_INFO from DR_MISALIGNMENT.
Will see if it is possible to reduce the testcase somewhat.


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

* [Bug tree-optimization/65450] [4.9/5 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (12 preceding siblings ...)
  2015-03-18  9:00 ` jakub at gcc dot gnu.org
@ 2015-03-18 10:49 ` jakub at gcc dot gnu.org
  2015-03-18 11:33 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-18 10:49 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35053|0                           |1
        is obsolete|                            |
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 35055
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35055&action=edit
gcc5-pr65450.patch

And now with the reduced testcase, going to bootstrap/regtest it now.


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

* [Bug tree-optimization/65450] [4.9/5 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (13 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-18 11:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think DR_PTR_INFO is indeed for the base object and was supposed to preserve
points-to-info only.  Patch looks ok.


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

* [Bug tree-optimization/65450] [4.9/5 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (14 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-18 13:29 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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

* [Bug tree-optimization/65450] [4.9/5 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (15 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-18 13:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Mar 18 13:54:12 2015
New Revision: 221490

URL: https://gcc.gnu.org/viewcvs?rev=221490&root=gcc&view=rev
Log:
    PR tree-optimization/65450
    * tree-vect-data-refs.c (vect_duplicate_ssa_name_ptr_info): New
    function.
    (vect_create_addr_base_for_vector_ref, vect_create_data_ref_ptr): Use
    it instead of duplicate_ssa_name_ptr_info.

    * gfortran.dg/pr65450.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr65450.f90
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-data-refs.c


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

* [Bug tree-optimization/65450] [4.9 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (16 preceding siblings ...)
  2015-03-18 13:54 ` jakub at gcc dot gnu.org
@ 2015-03-18 13:56 ` 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
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-18 13:56 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.8.0, 5.0
            Summary|[4.9/5 Regression]:         |[4.9 Regression]: Unaligned
                   |Unaligned access with -O3   |access with -O3 -mtune=k8
                   |-mtune=k8                   |
      Known to fail|                            |4.9.2

--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.


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

* [Bug tree-optimization/65450] [4.9 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (17 preceding siblings ...)
  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
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-03 15:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Jun  3 15:27:43 2015
New Revision: 224087

URL: https://gcc.gnu.org/viewcvs?rev=224087&root=gcc&view=rev
Log:
        Backported from mainline
        2015-03-18  Jakub Jelinek  <jakub@redhat.com>

        PR tree-optimization/65450
        * tree-vect-data-refs.c (vect_duplicate_ssa_name_ptr_info): New
        function.
        (vect_create_addr_base_for_vector_ref, vect_create_data_ref_ptr): Use
        it instead of duplicate_ssa_name_ptr_info.

        * gfortran.dg/pr65450.f90: New test.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gfortran.dg/pr65450.f90
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_9-branch/gcc/tree-vect-data-refs.c


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

* [Bug tree-optimization/65450] [4.9 Regression]: Unaligned access with -O3 -mtune=k8
  2015-03-17  9:37 [Bug fortran/65450] New: [5.0 Regression]: Unaligned access with -O3 -mtune=k8 ubizjak at gmail dot com
                   ` (18 preceding siblings ...)
  2015-06-03 15:28 ` jakub at gcc dot gnu.org
@ 2015-06-03 21:43 ` jakub at gcc dot gnu.org
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-03 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #20 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 4.9+.


^ 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).