public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/65407] Extra mask register move in gcc.target/i386/avx512f-kandnw-1.c
       [not found] <bug-65407-4@http.gcc.gnu.org/bugzilla/>
@ 2015-03-12 17:43 ` ubizjak at gmail dot com
  2015-03-27 15:13 ` vmakarov at gcc dot gnu.org
  2015-03-27 18:13 ` ubizjak at gmail dot com
  2 siblings, 0 replies; 3+ messages in thread
From: ubizjak at gmail dot com @ 2015-03-12 17:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ra
             Target|                            |x86
                 CC|                            |hjl.tools at gmail dot com,
                   |                            |kyukhin at gcc dot gnu.org,
                   |                            |vmakarov at gcc dot gnu.org

--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
Happens in reload:

(insn 17 11 19 2 (parallel [
            (set (reg:HI 69 k0 [104])
                (and:HI (not:HI (reg:HI 69 k0 [orig:100 k1 ] [100]))
                    (reg:HI 70 k1 [orig:102 k2 ] [102])))
            (clobber (reg:CC 17 flags))
        ]) /ssd/uros/gcc-build/prev-gcc/include/avx512fintrin.h:9995 388
{kandnhi}
     (nil))
...
(insn 36 21 29 2 (set (reg:HI 71 k2 [104])
        (reg:HI 69 k0 [104]))
/ssd/uros/gcc-build/prev-gcc/include/avx512fintrin.h:10718 92 {*movhi_internal}
     (nil))
(insn 29 36 31 2 (set (reg:V16SF 21 xmm0 [109])
        (vec_merge:V16SF (plus:V16SF (reg:V16SF 23 xmm2 [orig:91 D.26753 ]
[91])
                (reg:V16SF 22 xmm1 [orig:90 D.26753 ] [90]))
            (reg:V16SF 21 xmm0 [orig:92 D.26753 ] [92])
            (reg:HI 71 k2 [104])))
/ssd/uros/gcc-build/prev-gcc/include/avx512fintrin.h:10718 1356
{*addv16sf3_mask}
     (nil))

The constraint for mask register in (insn 29) is Yk (so, k1 to k7) and reload
satisfies this by emitting input reload from k0 -> k2. Ideally, k2 should be
chosen as output register from (insn 17).
>From gcc-bugs-return-480219-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 12 17:44:24 2015
Return-Path: <gcc-bugs-return-480219-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 58205 invoked by alias); 12 Mar 2015 17:44:24 -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 58147 invoked by uid 48); 12 Mar 2015 17:44:20 -0000
From: "uweigand at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/65408] New: powerpc64 function argument passing may access invalid memory
Date: Thu, 12 Mar 2015 17:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: uweigand at gcc dot gnu.org
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc cf_gcctarget
Message-ID: <bug-65408-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/msg01363.txt.bz2
Content-length: 1535

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

            Bug ID: 65408
           Summary: powerpc64 function argument passing may access invalid
                    memory
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: uweigand at gcc dot gnu.org
                CC: amodra at gcc dot gnu.org, bergner at gcc dot gnu.org,
                    meissner at gcc dot gnu.org
            Target: powerpc64-linux, powerpc64le-linux

The following simple test case:

struct test
{
  int x;
  int y;
  int z;
};

void func(struct test);

void foo(struct test *ptr)
{
  func(*ptr);
}

generates this code for "foo":
        ld 4,8(3)
        ld 3,0(3)
        bl func

Note how *16 bytes* of memory are accessed here.   This is wrong, since "struct
test" is only 12 bytes in size with 4-byte alignment, and if you have an array
of those, the last element may happen to reside just 12 bytes before a page
boundary, so accessing 16 bytes may in fact crash.

When using the -mstrict-align compiler option, we get instead:
        lwz 0,0(3)
        lwz 4,8(3)
        lwz 3,4(3)
        sldi 0,0,32
        or 3,3,0
        sldi 4,4,32
        bl func
which is less than optimal, but at least correct.

This bug seems to be present in all compiler versions I've tested (BE or LE),
modulo those that default to -mstrict-align (e.g. LE with -mtune=power7).


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

* [Bug target/65407] Extra mask register move in gcc.target/i386/avx512f-kandnw-1.c
       [not found] <bug-65407-4@http.gcc.gnu.org/bugzilla/>
  2015-03-12 17:43 ` [Bug target/65407] Extra mask register move in gcc.target/i386/avx512f-kandnw-1.c ubizjak at gmail dot com
@ 2015-03-27 15:13 ` vmakarov at gcc dot gnu.org
  2015-03-27 18:13 ` ubizjak at gmail dot com
  2 siblings, 0 replies; 3+ messages in thread
From: vmakarov at gcc dot gnu.org @ 2015-03-27 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
Author: vmakarov
Date: Fri Mar 27 14:47:24 2015
New Revision: 221734

URL: https://gcc.gnu.org/viewcvs?rev=221734&root=gcc&view=rev
Log:
2015-03-27  Vladimir Makarov  <vmakarov@redhat.com>

    PR target/65407
    * ira-costs.c (record_reg_classes): Process all constraint string
    containing 0-9.

2015-03-27  Vladimir Makarov  <vmakarov@redhat.com>

    PR target/65407
    * gcc.target/i386/avx512f-kandnw-1.c: Add scanning kmovw.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira-costs.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/i386/avx512f-kandnw-1.c


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

* [Bug target/65407] Extra mask register move in gcc.target/i386/avx512f-kandnw-1.c
       [not found] <bug-65407-4@http.gcc.gnu.org/bugzilla/>
  2015-03-12 17:43 ` [Bug target/65407] Extra mask register move in gcc.target/i386/avx512f-kandnw-1.c ubizjak at gmail dot com
  2015-03-27 15:13 ` vmakarov at gcc dot gnu.org
@ 2015-03-27 18:13 ` ubizjak at gmail dot com
  2 siblings, 0 replies; 3+ messages in thread
From: ubizjak at gmail dot com @ 2015-03-27 18:13 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3518 bytes --]

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.0

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
The compiler now generates expected code:
...
        kandnw  %k0, %k1, %k1
        vmovaps -112(%rbp), %zmm1
        vmovaps -112(%rbp), %zmm2
        vmovaps -112(%rbp), %zmm0
        vaddps  %zmm1, %zmm2, %zmm0{%k1}
...

Fixed.
>From gcc-bugs-return-482084-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Mar 27 18:03:37 2015
Return-Path: <gcc-bugs-return-482084-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 37257 invoked by alias); 27 Mar 2015 18:03:37 -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 37180 invoked by uid 48); 27 Mar 2015 18:03:33 -0000
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/65610] New: Compare debug failure with -g3 -fsanitize=undefined -fno-sanitize=vptr -O3
Date: Fri, 27 Mar 2015 18:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: sanitizer
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: burnus at gcc dot gnu.org
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc attachments.created
Message-ID: <bug-65610-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/msg03228.txt.bz2
Content-length: 977

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

            Bug ID: 65610
           Summary: Compare debug failure with -g3 -fsanitize=undefined
                    -fno-sanitize=vptr -O3
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

Created attachment 35166
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id5166&actioníit
input.ii - compile with g++ -fcompare-debug -std=c++11 -g3 -fsanitize=undefined
-fno-sanitize=vptr -O3

I get a
  -fcompare-debug failure (length)
failure for the attached program.

To reproduce:

$ g++ -fcompare-debug -std=c++11 -g3 -fsanitize=undefined -fno-sanitize=vptr
-O3 input.ii


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

end of thread, other threads:[~2015-03-27 18:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-65407-4@http.gcc.gnu.org/bugzilla/>
2015-03-12 17:43 ` [Bug target/65407] Extra mask register move in gcc.target/i386/avx512f-kandnw-1.c ubizjak at gmail dot com
2015-03-27 15:13 ` vmakarov at gcc dot gnu.org
2015-03-27 18:13 ` ubizjak at gmail dot com

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