This code causes ICE on gcc 4.0.3 on x86_64.

typedef long long vec __attribute__ ((vector_size(16)));
vec vecsqr(vec a) { return a*a; }

Commandline:

gcc -O1 -S -o - tmp.c

Resulting output:

        .file   "tmp.c"
tmp.c: In function 'vecsqr':
tmp.c:2: error: unrecognizable insn:
(insn 13 12 15 0 (set (reg:DI 58 [ D.1470 ])
        (vec_select:DI (reg/v:V2DI 61 [ a ])
            (parallel [
                    (const_int 1 [0x1])
                ]))) -1 (nil)
    (expr_list:REG_DEAD (reg/v:V2DI 61 [ a ])
        (nil)))
tmp.c:2: internal compiler error: in extract_insn, at recog.c:2020

It goes ICE on when -O option >= 1. -O0 does not trigger it.
Option -mno-sse also disables the ICE, but then it gives "error: SSE register
return with SSE disabled". -mno-sse2 doesn't disable it.
Unsigned/signed type has no effect to result. Without
__attribute__((vector_size)), it does not ICE.

GCC version (gcc -v):

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr
--disable-werror --enable-checking=release x86_64-linux-gnu
Thread model: posix
gcc version 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)


-- 
           Summary: ICE in multiplication of 16-byte longlong vector on
                    x86_64
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bisqwit at iki dot fi
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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

Reply via email to