Bug 26098 - [4.0 Regression] ICE in multiplication of 16-byte longlong vector on x86_64
Summary: [4.0 Regression] ICE in multiplication of 16-byte longlong vector on x86_64
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.3
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2006-02-04 19:59 UTC by Joel Yliluoma
Modified: 2007-02-03 16:15 UTC (History)
4 users (show)

See Also:
Host: x86_64-linux-gnu
Target: x86_64-linux-gnu
Build: x86_64-linux-gnu
Known to work: 3.4.6 4.1.0 4.2.0
Known to fail: 4.0.3 4.0.2
Last reconfirmed: 2006-02-04 20:11:01


Attachments
bug fix (1.58 KB, patch)
2006-03-10 19:09 UTC, Dinar Temirbulatov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Yliluoma 2006-02-04 19:59:47 UTC
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)
Comment 1 Andrew Pinski 2006-02-04 20:11:01 UTC
Confirmed, just a 4.0 regression.
Comment 2 Mark Mitchell 2006-02-27 20:29:50 UTC
Set to P2.  This bug is somewhat exotic, and not a regression from previous 4.0.x releases.
Comment 3 Dinar Temirbulatov 2006-03-10 19:09:05 UTC
Created attachment 11018 [details]
bug fix

this a backport form the mainline 

2005-05-17  Richard Henderson  <rth@redhat.com>

       * config/i386/sse.md (mulv16qi3, mulv2di3): New
Comment 4 Gabriel Dos Reis 2007-02-03 16:15:52 UTC
Fixed in GCC-4.1.0.