public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <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:00:00 -0000	[thread overview]
Message-ID: <bug-65450-4-5xLHd5Yf29@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65450-4@http.gcc.gnu.org/bugzilla/>

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.


  parent reply	other threads:[~2015-03-17 10:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17  9:37 [Bug fortran/65450] New: " 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-65450-4-5xLHd5Yf29@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).