public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/59843] New: ICE with return of generic vector on aarch64
@ 2014-01-16 14:54 jakub at gcc dot gnu.org
  2014-01-16 16:38 ` [Bug target/59843] " pinskia at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-16 14:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59843
           Summary: ICE with return of generic vector on aarch64
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org

typedef double V __attribute__ ((vector_size (8)));
V
foo (void)
{
  V r = { 3.5 };
  return r;
}

ICEs at all optimization levels on aarch64-linux, trying to return BLKmode
using a PARALLEL isn't going to work.  Seen both on the trunk and 4.8 branch.


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
@ 2014-01-16 16:38 ` pinskia at gcc dot gnu.org
  2014-01-16 17:25 ` yufeng at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-01-16 16:38 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-01-16
                 CC|                            |pinskia at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
  2014-01-16 16:38 ` [Bug target/59843] " pinskia at gcc dot gnu.org
@ 2014-01-16 17:25 ` yufeng at gcc dot gnu.org
  2014-03-20 14:46 ` yufeng at gcc dot gnu.org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: yufeng at gcc dot gnu.org @ 2014-01-16 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

Yufeng Zhang <yufeng at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|aarch64-linux               |aarch64-linux aarch64-elf
             Status|NEW                         |ASSIGNED
                 CC|                            |yufeng at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |yufeng at gcc dot gnu.org

--- Comment #2 from Yufeng Zhang <yufeng at gcc dot gnu.org> ---
Confirmed and assigned to myself.

test.c: In function 'foo':
test.c:6:3: internal compiler error: in emit_move_insn, at expr.c:3610
   return r;
   ^
0x63bbb0 emit_move_insn(rtx_def*, rtx_def*)
        gcc/gcc/expr.c:3610
0x63e1a2 emit_group_load_1
        gcc/gcc/expr.c:1750
0x63e5e9 emit_group_load(rtx_def*, rtx_def*, tree_node*, int)
        gcc/gcc/expr.c:1846
0x587c27 expand_value_return
        gcc/gcc/cfgexpand.c:3036
0x58ade6 expand_return
        gcc/gcc/cfgexpand.c:3114
0x58ade6 expand_gimple_stmt_1
        gcc/gcc/cfgexpand.c:3187
0x58ade6 expand_gimple_stmt
        gcc/gcc/cfgexpand.c:3309
0x58c024 expand_gimple_basic_block
        gcc/gcc/cfgexpand.c:5149
0x590536 gimple_expand_cfg
        gcc/gcc/cfgexpand.c:5715
0x590536 execute
        gcc/gcc/cfgexpand.c:5935
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
  2014-01-16 16:38 ` [Bug target/59843] " pinskia at gcc dot gnu.org
  2014-01-16 17:25 ` yufeng at gcc dot gnu.org
@ 2014-03-20 14:46 ` yufeng at gcc dot gnu.org
  2014-03-20 19:44 ` yufeng at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: yufeng at gcc dot gnu.org @ 2014-03-20 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Yufeng Zhang <yufeng at gcc dot gnu.org> ---
This issue is related to the handling of vector of one double in the AArch64
backend.  We don't have a corresponding type defined in ACLE (ARM C Language
Extension) the spec and backend is not able to handle it properly this moment.


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-03-20 14:46 ` yufeng at gcc dot gnu.org
@ 2014-03-20 19:44 ` yufeng at gcc dot gnu.org
  2014-07-02 13:41 ` ktkachov at gcc dot gnu.org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: yufeng at gcc dot gnu.org @ 2014-03-20 19:44 UTC (permalink / raw)
  To: gcc-bugs

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

Yufeng Zhang <yufeng at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
           Assignee|yufeng at gcc dot gnu.org          |unassigned at gcc dot gnu.org

--- Comment #4 from Yufeng Zhang <yufeng at gcc dot gnu.org> ---
Remove myself from assignee; I'm not working on it this moment.


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-03-20 19:44 ` yufeng at gcc dot gnu.org
@ 2014-07-02 13:41 ` ktkachov at gcc dot gnu.org
  2014-07-08 10:33 ` alalaw01 at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2014-07-02 13:41 UTC (permalink / raw)
  To: gcc-bugs

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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |ktkachov at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |alalaw01 at gcc dot gnu.org

--- Comment #5 from ktkachov at gcc dot gnu.org ---
Alan, I think you've fixed this on trunk as part of PR 60825 (at least we don't
ICE on trunk).
Can you check whether we need to backport anything and close this off when
appropriate?


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-07-02 13:41 ` ktkachov at gcc dot gnu.org
@ 2014-07-08 10:33 ` alalaw01 at gcc dot gnu.org
  2014-07-09 10:22 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: alalaw01 at gcc dot gnu.org @ 2014-07-08 10:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from alalaw01 at gcc dot gnu.org ---
Author: alalaw01
Date: Tue Jul  8 10:32:57 2014
New Revision: 212355

URL: https://gcc.gnu.org/viewcvs?rev=212355&root=gcc&view=rev
Log:
Backport r211502: PR target/59843 Fix arm_neon.h ZIP/UZP/TRN for bigendian

    2014-06-10  Alan Lawrence  <alan.lawrence@arm.com>

    gcc/:
        * config/aarch64/aarch64-modes.def: Add V1DFmode.
        * config/aarch64/aarch64.c (aarch64_vector_mode_supported_p):
        Support V1DFmode.

    gcc/testsuite/:
           * gcc.dg/vect/vect-singleton_1.c: New file.



Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/vect/vect-singleton_1.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/config/aarch64/aarch64-modes.def
    branches/gcc-4_9-branch/gcc/config/aarch64/aarch64.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-07-08 10:33 ` alalaw01 at gcc dot gnu.org
@ 2014-07-09 10:22 ` jakub at gcc dot gnu.org
  2014-07-09 15:45 ` alan.lawrence at arm dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-07-09 10:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Isn't even this change ABI changing?  I know you ICE when returning such
vectors, but doesn't the change from BLKmode to V1DFmode change how such vars
are laid out in structures, or passed in as arguments, or when present in
aggregates (structs/unions) passed by value etc.?


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2014-07-09 10:22 ` jakub at gcc dot gnu.org
@ 2014-07-09 15:45 ` alan.lawrence at arm dot com
  2014-07-09 15:54 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: alan.lawrence at arm dot com @ 2014-07-09 15:45 UTC (permalink / raw)
  To: gcc-bugs

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

Alan Lawrence <alan.lawrence at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alan.lawrence at arm dot com

--- Comment #8 from Alan Lawrence <alan.lawrence at arm dot com> ---
Passing a vector of one double as argument also ICE'd prior to this patch, so
no worries there. Likewise passing such a vector in as varargs.

Regarding struct layout:

*IIUC, gcc generally lays out structs in memory according to the sizes of the
data members, which hasn't changed.

*The AAPCS64 does not mention gcc vector extensions explicitly, only the
architectural concept of short vectors, but if we consider gcc vector
extensions as mapping to these short vectors (as they have done) - then there
is no dependency on gcc's concept of "mode".

*I've verified this with some by-hand testcases, using
typedef double gcc_vector_f64x1 __attribute__ ((__vector_size__ ((8))));
passing and returning by value
    *a small struct of a single gcc_vector_f64x1
    *a small struct of a char and a gcc_vector_f64x1
    *a struct of four gcc_vector_f64x1's (classed as a Homogenous Vector
Aggregate)
....all passed in registers, and
    *a large struct (of over 16 bytes, containing char, gcc_vector_f64x1, char,
gcc_vector_f64x2)
...written to memory and passing a pointer. Also explicitly passing pointers to
structs in memory. In all cases the layout (in registers/memory) is the same
regardless of whether we have V1DFmode or the gcc_vector_f64x1 is just assigned
BLKmode. (FWIW code generation is usually, tho not in all cases, better with
V1DFmode.)

Do you believe the ABI has changed, or are you merely concerned that it may
have? Whilst I can never claim my checks have been exhaustive, at this point I
don't see reason for concern.


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2014-07-09 15:45 ` alan.lawrence at arm dot com
@ 2014-07-09 15:54 ` jakub at gcc dot gnu.org
  2014-07-09 16:16 ` alan.lawrence at arm dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-07-09 15:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I've been just concerned, many backends derive (perhaps incorrectly) passing
conventions from DECL_MODE or TYPE_MODE and so any changes in that are a red
flag to me.
If passing as arguments and returning the vectors sized the same as element
size always ICEd, then it is not an ABI issue, because any old program using
those wouldn't compile.  Are the ICEs on both the caller and callee side
though?
I mean, which of these tests ICE?
test1.c:
typedef double V __attribute__ ((vector_size (8)));
V foo (void);
V x;
void bar (void)
{
  x = foo ();
}
test2.c:
typedef double V __attribute__ ((vector_size (8)));
void foo (V);
V x;
void bar (void)
{
  foo (x);
}
test3.c:
typedef double V __attribute__ ((vector_size (8)));
V x;
V foo (void)
{
  return x;
}
test4.c:
typedef double V __attribute__ ((vector_size (8)));
V x;
void foo (V y)
{
  x = y;
}

If not all 4 ICE, then perhaps one could compile with 4.9.0 objects containing
just the caller (or just the callee) and try to put it together with 4.9.1
built objects.


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2014-07-09 15:54 ` jakub at gcc dot gnu.org
@ 2014-07-09 16:16 ` alan.lawrence at arm dot com
  2014-11-18 16:40 ` alan.lawrence at arm dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: alan.lawrence at arm dot com @ 2014-07-09 16:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Alan Lawrence <alan.lawrence at arm dot com> ---
I can confirm that prior to V1DFmode, all four of those cases gave an ICE (in
emit_move_insn, via a variety of routes).


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2014-07-09 16:16 ` alan.lawrence at arm dot com
@ 2014-11-18 16:40 ` alan.lawrence at arm dot com
  2014-11-18 16:43 ` jakub at gcc dot gnu.org
  2014-11-19 10:12 ` alalaw01 at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: alan.lawrence at arm dot com @ 2014-11-18 16:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Alan Lawrence <alan.lawrence at arm dot com> ---
As I understand it, This is fixed in both 4.9 and 5.0 branch. Is there any more
we want to do or can it now be closed?


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2014-11-18 16:40 ` alan.lawrence at arm dot com
@ 2014-11-18 16:43 ` jakub at gcc dot gnu.org
  2014-11-19 10:12 ` alalaw01 at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-11-18 16:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If this is fixed even on the trunk (#c6 mentions just 4.9), then it is fine to
close this IMHO.


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

* [Bug target/59843] ICE with return of generic vector on aarch64
  2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2014-11-18 16:43 ` jakub at gcc dot gnu.org
@ 2014-11-19 10:12 ` alalaw01 at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: alalaw01 at gcc dot gnu.org @ 2014-11-19 10:12 UTC (permalink / raw)
  To: gcc-bugs

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

alalaw01 at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #13 from alalaw01 at gcc dot gnu.org ---
Fixed on trunk in r211502 and backported to 4.9.


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

end of thread, other threads:[~2014-11-19 10:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-16 14:54 [Bug target/59843] New: ICE with return of generic vector on aarch64 jakub at gcc dot gnu.org
2014-01-16 16:38 ` [Bug target/59843] " pinskia at gcc dot gnu.org
2014-01-16 17:25 ` yufeng at gcc dot gnu.org
2014-03-20 14:46 ` yufeng at gcc dot gnu.org
2014-03-20 19:44 ` yufeng at gcc dot gnu.org
2014-07-02 13:41 ` ktkachov at gcc dot gnu.org
2014-07-08 10:33 ` alalaw01 at gcc dot gnu.org
2014-07-09 10:22 ` jakub at gcc dot gnu.org
2014-07-09 15:45 ` alan.lawrence at arm dot com
2014-07-09 15:54 ` jakub at gcc dot gnu.org
2014-07-09 16:16 ` alan.lawrence at arm dot com
2014-11-18 16:40 ` alan.lawrence at arm dot com
2014-11-18 16:43 ` jakub at gcc dot gnu.org
2014-11-19 10:12 ` alalaw01 at gcc dot gnu.org

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