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 tree-optimization/59679] gcc version 4.7.3 and gcc version 4.5.3 cause an unaligned access exception on NetBSD/Alpha
Date: Tue, 28 Jan 2014 16:54:00 -0000	[thread overview]
Message-ID: <bug-59679-4-uZxYxsr5rT@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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
          Component|target                      |tree-optimization
   Target Milestone|---                         |4.7.4

--- Comment #13 from Uroš Bizjak <ubizjak at gmail dot com> ---
Confirmed as tree-optimization problem on 4.9 branch.

The compiler was build as a crosscompiler from x86_64-linux-gnu to
alpha-linux-gnu, configured with "configure --target=alpha-linux-gnu".

The preprocessed source from comment 12 is compiled with:

a) gcc-build-alpha/gcc/cc1 -O2 -fno-tree-ter -fpreprocessed
scope-reduced-preprocessed.c
b) gcc-build-alpha/gcc/cc1 -O2 -fpreprocessed scope-reduced-preprocessed.c

where a) creates correct binary (scope-reduced.s) and b) creates wrong binary
(scope-reduced_.s).

The difference between scope-reduced.s (correct) and scope-reduced_.s (wrong):

--- scope-reduced.s     2014-01-28 17:45:07.803092987 +0100
+++ scope-reduced_.s    2014-01-28 17:44:50.365312704 +0100
@@ -16,7 +16,7 @@
 $Perl_leave_scope..ng:
        lda $30,-16($30)
        cpys $f31,$f31,$f31
-       mov $31,$5
+       mov $31,$6
        ldl $1,48($16)
        mov $31,$8
        stq $26,0($30)
@@ -33,10 +33,10 @@
        s8addq $2,$1,$1
        ldq $3,0($1)
        and $3,63,$18
-       cmpule $18,4,$6
-       bne $6,$L3
+       cmpule $18,4,$5
+       bne $5,$L3
        cmpule $18,20,$2
-       ldq $5,-8($1)
+       ldq $6,-8($1)
        beq $2,$L4
        lda $2,-8($1)
 $L5:
@@ -65,14 +65,12 @@
        br $31,$L5
        .align 4
 $L17:
-       sll $3,48,$3
-       ldq_u $1,0($5)
-       sra $3,56,$3
-       mskbl $1,$5,$1
-       insbl $3,$5,$3
+       extbl $3,1,$3
+       ldl $1,0($6)
+       bic $1,255,$1
        cpys $f31,$f31,$f31
        bis $3,$1,$3
-       stq_u $3,0($5)
+       stl $3,0($6)
        ldl $1,48($16)
        cmplt $17,$1,$2
        bne $2,$L12
@@ -84,24 +82,24 @@
 $L9:
        ldl $2,12($8)
        ldl $1,48($16)
-       bis $5,$2,$2
+       bis $6,$2,$2
        stl $2,12($8)
        br $31,$L2
        .align 4
 $L8:
        ldq $3,0($16)
        ldq $22,24($16)
-       ldq $4,0($5)
+       ldq $4,0($6)
        bis $31,$31,$31
        mov $2,$1
-       ldq $6,0($7)
+       ldq $5,0($7)
        subq $3,$22,$2
        cpys $f31,$f31,$f31
        sra $2,3,$2
        stq $2,16($4)
        ldq $4,16($7)
-       ldq $3,24($6)
-       ldq $2,16($6)
+       ldq $3,24($5)
+       ldq $2,16($5)
        stq $4,24($16)
        s8addq $3,$4,$3
        stq $7,184($16)

The problem can be seen just after $L17 label.
>From gcc-bugs-return-441770-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jan 28 16:59:36 2014
Return-Path: <gcc-bugs-return-441770-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 6231 invoked by alias); 28 Jan 2014 16:59:36 -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 6199 invoked by uid 48); 28 Jan 2014 16:59:33 -0000
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/59968] Unused BT patterns
Date: Tue, 28 Jan 2014 16:59: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.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: hjl.tools 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: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59968-4-dUREX0yVxt@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59968-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59968-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/msg02912.txt.bz2
Content-length: 456

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY968

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
For

int
__attribute__((noinline))
foo1 (int x, int y)
{
  x &= (1 << y);
  return x != 0;
}

we generate

    movl    %esi, %ecx
    movl    $1, %eax
    sall    %cl, %eax
    testl    %edi, %eax
    setne    %al
    movzbl    %al, %eax
    ret

I am expecting:

    bt      %esi, %edi
    setc    %al
        movzbl    %al, %eax
        ret


  parent reply	other threads:[~2014-01-28 16:54 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 ` ubizjak at gmail dot com [this message]
2014-01-28 17:17 ` [Bug tree-optimization/59679] " 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
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-uZxYxsr5rT@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).