Bug 65491 - [aarch64] ICE: in emit_move_insn, at expr.c:3609
Summary: [aarch64] ICE: in emit_move_insn, at expr.c:3609
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: ktkachov
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2015-03-20 10:55 UTC by David Abdurachmanov
Modified: 2015-08-19 15:40 UTC (History)
0 users

See Also:
Host:
Target: aarch64-*-*
Build:
Known to work: 6.0
Known to fail: 4.8.5, 4.9.3, 5.0
Last reconfirmed: 2015-03-20 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Abdurachmanov 2015-03-20 10:55:31 UTC
Storing a single long double in a vector will cause GCC 4.9.2 and GCC 5.0.0 to ICE on AArch64:

typedef long double a __attribute__((vector_size (16)));

a sum(a first, a second) {
  return first + second;
}

a.c:3:3: internal compiler error: in emit_move_insn, at expr.c:3609
 a sum(a first, a second) {
   ^
Please submit a full bug report,
with preprocessed source if appropriate.

On GCC 5.0.0 (F22) it reports expr.c:3601

Any other argument for vector_size seems to work just fine. Tested up to 2048.
Comment 1 ktkachov 2015-03-20 10:58:35 UTC
Confirmed on all release branches.
Comment 2 ktkachov 2015-03-24 13:41:14 UTC
I've got a fix in testing
Comment 3 ktkachov 2015-05-22 14:36:59 UTC
Author: ktkachov
Date: Fri May 22 14:36:27 2015
New Revision: 223577

URL: https://gcc.gnu.org/viewcvs?rev=223577&root=gcc&view=rev
Log:
[AArch64] PR target/65491: Classify V1TF vectors as AAPCS64 short vectors rather than composite types

	PR target/65491
	* config/aarch64/aarch64.c (aarch64_short_vector_p): Move above
	aarch64_composite_type_p.  Remove check for aarch64_composite_type_p.
	(aarch64_composite_type_p): Return false if given type and mode are
	for a short vector.

	PR target/65491
	* gcc.target/aarch64/pr65491_1.c: New test.
	* gcc.target/aarch64/aapcs64/type-def.h (vlf1_t): New typedef.
	* gcc.target/aarch64/aapcs64/func-ret-1.c: Add test for vlf1_t.

Added:
    trunk/gcc/testsuite/gcc.target/aarch64/pr65491_1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/aarch64/aarch64.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-1.c
    trunk/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h
Comment 4 ktkachov 2015-05-22 14:40:29 UTC
Fixed on trunk. Since this has been failing on all release branches, this is not a regression fix, so no backporting
Comment 5 Andrey Tarasevich 2015-08-19 14:48:44 UTC
Test pr65491.c fails on on darwin14.5 x86_64

GCC was compiled from SVN trunk revision 226781

gcc -v -save-temps /Users/sevich/work/source/gcc_trunk_git/gcc/testsuite//gcc.target//aarch64//pr65491_1.c
Using built-in specs.
COLLECT_GCC=/Users/sevich/work/build_normal/bin/gcc
COLLECT_LTO_WRAPPER=/Users/sevich/work/build_normal/libexec/gcc/x86_64-apple-darwin14.5.0/6.0.0/lto-wrapper
Target: x86_64-apple-darwin14.5.0
Configured with: /Users/sevich/work/source/gcc_trunk_git/configure --disable-bootstrap --enable-languages=c,c++ --prefix=/Users/sevich/work/build_normal/
Thread model: posix
gcc version 6.0.0 20150811 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.10.5' '-v' '-save-temps' '-mtune=core2'
 /Users/sevich/work/build_normal/libexec/gcc/x86_64-apple-darwin14.5.0/6.0.0/cc1 -E -quiet -v -D__DYNAMIC__ /Users/sevich/work/source/gcc_trunk_git/gcc/testsuite//gcc.target//aarch64//pr65491_1.c -fPIC -mmacosx-version-min=10.10.5 -mtune=core2 -fpch-preprocess -o pr65491_1.i
ignoring nonexistent directory "/Users/sevich/work/build_normal/lib/gcc/x86_64-apple-darwin14.5.0/6.0.0/../../../../x86_64-apple-darwin14.5.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /Users/sevich/work/build_normal/lib/gcc/x86_64-apple-darwin14.5.0/6.0.0/include
 /usr/local/include
 /Users/sevich/work/build_normal/include
 /Users/sevich/work/build_normal/lib/gcc/x86_64-apple-darwin14.5.0/6.0.0/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.10.5' '-v' '-save-temps' '-mtune=core2'
 /Users/sevich/work/build_normal/libexec/gcc/x86_64-apple-darwin14.5.0/6.0.0/cc1 -fpreprocessed pr65491_1.i -fPIC -quiet -dumpbase pr65491_1.c -mmacosx-version-min=10.10.5 -mtune=core2 -auxbase pr65491_1 -version -o pr65491_1.s
GNU C11 (GCC) version 6.0.0 20150811 (experimental) (x86_64-apple-darwin14.5.0)
	compiled by GNU C version 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53), GMP version 6.0.0, MPFR version 3.1.2, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C11 (GCC) version 6.0.0 20150811 (experimental) (x86_64-apple-darwin14.5.0)
	compiled by GNU C version 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53), GMP version 6.0.0, MPFR version 3.1.2, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 700dea0ce5ef3b798edb9c9160a43b26
/Users/sevich/work/source/gcc_trunk_git/gcc/testsuite//gcc.target//aarch64//pr65491_1.c: In function ‘sum’:
/Users/sevich/work/source/gcc_trunk_git/gcc/testsuite//gcc.target//aarch64//pr65491_1.c:7:1: error: mode precision of non-integral result does not match field size of BIT_FIELD_REF
 sum (a first, a second)
 ^
BIT_FIELD_REF <first_1(D), 128, 0>
/Users/sevich/work/source/gcc_trunk_git/gcc/testsuite//gcc.target//aarch64//pr65491_1.c:9:16: note: in statement
   return first + second;
                ^
_6 = BIT_FIELD_REF <first_1(D), 128, 0>;
/Users/sevich/work/source/gcc_trunk_git/gcc/testsuite//gcc.target//aarch64//pr65491_1.c:7:1: error: mode precision of non-integral result does not match field size of BIT_FIELD_REF
 sum (a first, a second)
 ^
BIT_FIELD_REF <second_2(D), 128, 0>
/Users/sevich/work/source/gcc_trunk_git/gcc/testsuite//gcc.target//aarch64//pr65491_1.c:9:16: note: in statement
   return first + second;
                ^
_7 = BIT_FIELD_REF <second_2(D), 128, 0>;
/Users/sevich/work/source/gcc_trunk_git/gcc/testsuite//gcc.target//aarch64//pr65491_1.c:7:1: internal compiler error: verify_gimple failed
 sum (a first, a second)
 ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 6 Andrew Pinski 2015-08-19 15:40:34 UTC
(In reply to Andrey Tarasevich from comment #5)
> Test pr65491.c fails on on darwin14.5 x86_64
> 
> GCC was compiled from SVN trunk revision 226781

Please file this as a separate bug.