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 middle-end/59679] gcc version 4.7.3 and gcc version 4.5.3 cause an unaligned access exception on NetBSD/Alpha
Date: Wed, 29 Jan 2014 16:39:00 -0000	[thread overview]
Message-ID: <bug-59679-4-wTDeaWNVwh@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59679-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #17 from Uroš Bizjak <ubizjak at gmail dot com> ---
Some more analysis:

The target code expands non-bwx QImode store

;; MEM[(I8 *)_67] = _69;

via alpha_expand_mov_nobwx, where around line 2229 (config/alpha.c) target
address gets checked with "aligned_memory_operand" predicate.  The pointer is
"reg/v/f:DI 115 [ arg0 ])", and its REGNO_POINTER_ALIGN is 64. This later datum
makes aligned_memory_operand predicate to return true.

The pointer alignment for reg 115 is set in mark_reg_pointer from

(insn 68 67 69 (set (reg/f:DI 134)
        (mem/f:DI (reg/v/f:DI 115 [ arg0 ]) [2 MEM[(struct AV *)_p_36].sv_any+0
S8 A64])) scope-reduced.c:53 -1
     (nil))

since reg 115 is used naked to access 64bit aligned value.

The above (insn 68) is defined in BB 11, where the only predecessor is BB 10 (a
switch), and the only successor is BB 15.

Hovever (insn 101):

(insn 101 100 102 (set (reg:SI 150)
        (mem:SI (reg/v/f:DI 115 [ arg0 ]) [0  S4 A8])) scope-reduced.c:60 -1
     (nil))

which assumes 64 bit pointer alignment, lives in BB 13. Again, the only
predecessor is BB 10, and the only successor is BB 15.

The initialization of reg 115 is in BB 4 from a memory location:

(insn 27 26 0 (set (reg/v:DI 115 [ arg0 ])
        (mem:DI (plus:DI (reg/v/f:DI 76 [ p0 ])
                (const_int -8 [0xfffffffffffffff8])) [27 MEM[(union ANY *)p0_16
+ -8B]+0 S8 A64])) scope-reduced.c:37 -1
     (nil))

and since everything is inside a loop, it looks to me there is no way for GCC
to assume inheritance of pointer alignments in BB 13 from BB 10.
>From gcc-bugs-return-441927-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 29 16:44:39 2014
Return-Path: <gcc-bugs-return-441927-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28528 invoked by alias); 29 Jan 2014 16:44:38 -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 28499 invoked by uid 48); 29 Jan 2014 16:44:34 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/59679] gcc version 4.7.3 and gcc version 4.5.3 cause an unaligned access exception on NetBSD/Alpha
Date: Wed, 29 Jan 2014 16:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.7.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.7.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-59679-4-56zZw9xLNS@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59679-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59679-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg03069.txt.bz2
Content-length: 729

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at redhat dot com

--- Comment #18 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #17)

> and since everything is inside a loop, it looks to me there is no way for
> GCC to assume inheritance of pointer alignments in BB 13 from BB 10.

The last line should read:

GCC to assume inheritance of pointer alignments in BB 13 from BB 11.

This is middle-end infrastructure problem. Adding CC.
>From gcc-bugs-return-441928-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 29 16:46:04 2014
Return-Path: <gcc-bugs-return-441928-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29519 invoked by alias); 29 Jan 2014 16:46:04 -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 29498 invoked by uid 48); 29 Jan 2014 16:46:01 -0000
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/21609] array_allocator vs rebind & templated constructor
Date: Wed, 29 Jan 2014 16:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.0.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paolo.carlini at oracle dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-21609-4-f17IXYjFZT@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-21609-4@http.gcc.gnu.org/bugzilla/>
References: <bug-21609-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: 2014-01/txt/msg03070.txt.bz2
Content-length: 161

http://gcc.gnu.org/bugzilla/show_bug.cgi?id!609

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> ---
I agree, let's deprecate it for 4.9.


  parent reply	other threads:[~2014-01-29 16:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-05  1:57 [Bug c/59679] New: " nullnilaki at gmail dot com
2014-01-05 20:57 ` [Bug target/59679] " nullnilaki at gmail dot com
2014-01-05 20:57 ` nullnilaki at gmail dot com
2014-01-05 21:02 ` nullnilaki at gmail dot com
2014-01-05 23:08 ` pinskia at gcc dot gnu.org
2014-01-06 16:01 ` nullnilaki at gmail dot com
2014-01-06 16:32 ` nullnilaki at gmail dot com
2014-01-06 16:56 ` nullnilaki at gmail dot com
2014-01-06 16:57 ` nullnilaki at gmail dot com
2014-01-26 22:56 ` mcree at orcon dot net.nz
2014-01-26 23:00 ` mcree at orcon dot net.nz
2014-01-26 23:01 ` mcree at orcon dot net.nz
2014-01-28 16:54 ` [Bug tree-optimization/59679] " ubizjak at gmail dot com
2014-01-28 17:17 ` ubizjak at gmail dot com
2014-01-28 18:25 ` [Bug middle-end/59679] " ubizjak at gmail dot com
2014-01-29 16:39 ` ubizjak at gmail dot com [this message]
2014-06-12 13:53 ` rguenth 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-59679-4-wTDeaWNVwh@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).