public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/60204] New: struct with __m512i is mishandled in function parameter passing and return
@ 2014-02-14 20:26 hjl.tools at gmail dot com
  2014-02-18 16:54 ` [Bug target/60204] " hjl.tools at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hjl.tools at gmail dot com @ 2014-02-14 20:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60204
           Summary: struct with __m512i is mishandled in function
                    parameter passing and return
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: kirill.yukhin at intel dot com

[hjl@gnu-6 avx512-1]$ cat x.i
typedef long long __m512i __attribute__ ((__vector_size__ (64),
__may_alias__));

struct m512i
{
  __m512i x;
};

typedef long long __m256i __attribute__ ((__vector_size__ (32),
__may_alias__));

struct m256i
{
  __m256i x;
};

struct m256i
foo1 (struct m256i x, struct m256i y, struct m256i z)
{
  return z;
}

struct m512i
foo2 (struct m512i x, struct m512i y, struct m512i z)
{
  return z;
}
[hjl@gnu-6 avx512-1]$ make
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -mavx512f -O2 -S x.i
[hjl@gnu-6 avx512-1]$ cat x.s
    .file    "x.i"
    .section    .text.unlikely,"ax",@progbits
.LCOLDB0:
    .text
.LHOTB0:
    .p2align 4,,15
    .globl    foo1
    .type    foo1, @function
foo1:
.LFB0:
    .cfi_startproc
    vmovdqa    %ymm2, %ymm0
    ret
    .cfi_endproc
.LFE0:
    .size    foo1, .-foo1
    .section    .text.unlikely
.LCOLDE0:
    .text
.LHOTE0:
    .section    .text.unlikely
.LCOLDB1:
    .text
.LHOTB1:
    .p2align 4,,15
    .globl    foo2
    .type    foo2, @function
foo2:
.LFB1:
    .cfi_startproc
    vmovdqa64    136(%rsp), %zmm0
    movq    %rdi, %rax
    vmovdqa64    %zmm0, (%rdi)
    ret
    .cfi_endproc
.LFE1:
    .size    foo2, .-foo2
    .section    .text.unlikely
.LCOLDE1:
    .text
.LHOTE1:
    .ident    "GCC: (GNU) 4.9.0 20140214 (experimental)"
    .section    .note.GNU-stack,"",@progbits
[hjl@gnu-6 avx512-1]$ 

I am expecting struct m512i is passed/returned in zmm register per
AVX-512 extension to x86-64 psABI.


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

* [Bug target/60204] struct with __m512i is mishandled in function parameter passing and return
  2014-02-14 20:26 [Bug target/60204] New: struct with __m512i is mishandled in function parameter passing and return hjl.tools at gmail dot com
@ 2014-02-18 16:54 ` hjl.tools at gmail dot com
  2014-02-19  9:48 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: hjl.tools at gmail dot com @ 2014-02-18 16:54 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-18
     Ever confirmed|0                           |1

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to tocarip.intel from comment #1)
> From 
> https://github.com/hjl-tools/x86-64-psABI/blob/hjl/avx512/low-level-sys-info.
> tex  
> \item If the size of an object is larger than four \eightbytes, or
>   it contains unaligned fields, it has class MEMORY
> 
> struct m512i has size of 64 bytes, which is larger than 8*4=32, so it has
> class MEMORY and passed on the stack.
> 
> It looks like everything is according to ABI.

It is a bug in psABI.  It should read as "eight \eightbytes".


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

* [Bug target/60204] struct with __m512i is mishandled in function parameter passing and return
  2014-02-14 20:26 [Bug target/60204] New: struct with __m512i is mishandled in function parameter passing and return hjl.tools at gmail dot com
  2014-02-18 16:54 ` [Bug target/60204] " hjl.tools at gmail dot com
@ 2014-02-19  9:48 ` ubizjak at gmail dot com
  2014-02-19 11:03 ` tocarip.intel at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2014-02-19  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ubizjak at gmail dot com
   Target Milestone|---                         |4.9.0
           Severity|normal                      |major

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to H.J. Lu from comment #2)

> It is a bug in psABI.  It should read as "eight \eightbytes".

So, let's fix the psABI first and then fix gcc.

This PR should be resolved before 4.9 is released.
>From gcc-bugs-return-444185-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Feb 19 09:52:19 2014
Return-Path: <gcc-bugs-return-444185-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 15137 invoked by alias); 19 Feb 2014 09:52:19 -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 14721 invoked by uid 48); 19 Feb 2014 09:52:15 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/60204] struct with __m512i is mishandled in function parameter passing and return
Date: Wed, 19 Feb 2014 09:52: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: ABI, wrong-code
X-Bugzilla-Severity: major
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.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60204-4-uh5NjFq4HY@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60204-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60204-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-02/txt/msg01942.txt.bz2
Content-length: 340

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

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

> So, let's fix the psABI first and then fix gcc.

psABI is fixed in [1].

[1]
https://github.com/hjl-tools/x86-64-psABI/commit/6d7ccd614fe67111d2aecec853c3df0310b372d2
>From gcc-bugs-return-444186-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Feb 19 09:56:45 2014
Return-Path: <gcc-bugs-return-444186-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20016 invoked by alias); 19 Feb 2014 09:56:45 -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 19969 invoked by uid 48); 19 Feb 2014 09:56:42 -0000
From: "aoliva at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/57232] wcstol.c:213:1: internal compiler error
Date: Wed, 19 Feb 2014 09:56: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.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: aoliva at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: aoliva at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: assigned_to
Message-ID: <bug-57232-4-lrdGBBr3Oj@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57232-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57232-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-02/txt/msg01943.txt.bz2
Content-length: 791

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |aoliva at gcc dot gnu.org

--- Comment #15 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Mine.  It looks like the call to cselib_preserve_cfa_base_value in
vt_initialize should be guarded by some conditions, like this:

      if (reg != hard_frame_pointer_rtx && fixed_regs[REGNO (reg)])
    cselib_preserve_cfa_base_value (val, REGNO (reg));

This fixes the reported problem for me (though I haven't otherwise regtested
it).  Daniel, Jon, Nick, Sebastian, does it fix the problem for you?


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

* [Bug target/60204] struct with __m512i is mishandled in function parameter passing and return
  2014-02-14 20:26 [Bug target/60204] New: struct with __m512i is mishandled in function parameter passing and return hjl.tools at gmail dot com
  2014-02-18 16:54 ` [Bug target/60204] " hjl.tools at gmail dot com
  2014-02-19  9:48 ` ubizjak at gmail dot com
@ 2014-02-19 11:03 ` tocarip.intel at gmail dot com
  2014-02-20  6:32 ` kyukhin at gcc dot gnu.org
  2014-02-20 13:17 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: tocarip.intel at gmail dot com @ 2014-02-19 11:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from tocarip.intel at gmail dot com ---
Created attachment 32169
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32169&action=edit
Proposed patch.

Currently testing attached patch.


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

* [Bug target/60204] struct with __m512i is mishandled in function parameter passing and return
  2014-02-14 20:26 [Bug target/60204] New: struct with __m512i is mishandled in function parameter passing and return hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2014-02-19 11:03 ` tocarip.intel at gmail dot com
@ 2014-02-20  6:32 ` kyukhin at gcc dot gnu.org
  2014-02-20 13:17 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: kyukhin at gcc dot gnu.org @ 2014-02-20  6:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Kirill Yukhin <kyukhin at gcc dot gnu.org> ---
Author: kyukhin
Date: Thu Feb 20 06:32:21 2014
New Revision: 207933

URL: http://gcc.gnu.org/viewcvs?rev=207933&root=gcc&view=rev
Log:
gcc/
    PR target/60204
    * config/i386/i386.c (classify_argument): Pass structures of size
    64 bytes or less in register.

tessuite/gcc/
    PR target/60204
    * gcc.target/x86_64/abi/avx512f/test_passing_structs.c: Update to
    reflect abi fix.
    * gcc.target/x86_64/abi/avx512f/test_passing_unions.c: Ditto.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/x86_64/abi/avx512f/test_passing_structs.c
    trunk/gcc/testsuite/gcc.target/x86_64/abi/avx512f/test_passing_unions.c


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

* [Bug target/60204] struct with __m512i is mishandled in function parameter passing and return
  2014-02-14 20:26 [Bug target/60204] New: struct with __m512i is mishandled in function parameter passing and return hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2014-02-20  6:32 ` kyukhin at gcc dot gnu.org
@ 2014-02-20 13:17 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2014-02-20 13:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2014-02/msg01147.htm
                   |                            |l
         Resolution|---                         |FIXED

--- Comment #7 from Uroš Bizjak <ubizjak at gmail dot com> ---
Fixed.
>From gcc-bugs-return-444361-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 20 13:19:00 2014
Return-Path: <gcc-bugs-return-444361-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13172 invoked by alias); 20 Feb 2014 13:19:00 -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 13045 invoked by uid 55); 20 Feb 2014 13:18:56 -0000
From: "ro at CeBiTec dot Uni-Bielefeld.DE" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/60290] 32-bit g++.dg/cilk-plus/CK/catch_exc.cc FAILs on Solaris/x86
Date: Thu, 20 Feb 2014 13:19: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: ro at CeBiTec dot Uni-Bielefeld.DE
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60290-4-j8HEE1uM5y@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60290-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60290-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-02/txt/msg02118.txt.bz2
Content-length: 306

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`290

--- Comment #2 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> Even with the r207623 fix?

Yes, this is from the latest r207783 bootstraps.

    Rainer


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

end of thread, other threads:[~2014-02-20 13:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 20:26 [Bug target/60204] New: struct with __m512i is mishandled in function parameter passing and return hjl.tools at gmail dot com
2014-02-18 16:54 ` [Bug target/60204] " hjl.tools at gmail dot com
2014-02-19  9:48 ` ubizjak at gmail dot com
2014-02-19 11:03 ` tocarip.intel at gmail dot com
2014-02-20  6:32 ` kyukhin at gcc dot gnu.org
2014-02-20 13:17 ` 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).