Bug 19350 - Compilation with -O1 -ftree-vectorize gives unrecognizable insn on x86.
Summary: Compilation with -O1 -ftree-vectorize gives unrecognizable insn on x86.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P1 normal
Target Milestone: 4.0.0
Assignee: Richard Henderson
URL:
Keywords: ice-on-valid-code, ssemmx
Depends on:
Blocks:
 
Reported: 2005-01-09 20:42 UTC by Martin Drab
Modified: 2005-01-20 10:18 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2005-01-20 09:52:49


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Drab 2005-01-09 20:42:58 UTC
Following test code

-- test.c -------------------------------
typedef struct { int x; int y[16]; } ta;
typedef struct { int y[16]; } tb;
void f (tb *b)
{
        int i, j; ta *a;
        for (i=0, j=a->x; i<j; i++) b->y[i] = a->y[i];
}
-----------------------------------------

when compiled with

-----------------------------------------
gcc -O1 -ftree-vectorize -S test.c -o test.s
-----------------------------------------

using

-----------------------------------------
$ gcc -v
Using built-in specs.
Configured with: ../../../gcc-CVS-20050107/gcc-CVS-20050107/configure
--host=i786-pc-linux-gnu --prefix=/usr/local/opt/gcc-4.0
--exec-prefix=/usr/local/opt/gcc-4.0 --sysconfdir=/etc
--libdir=/usr/local/opt/gcc-4.0/lib --libexecdir=/usr/local/opt/gcc-4.0/libexec
--sharedstatedir=/var --localstatedir=/var --program-suffix=-4.0
--with-x-includes=/usr/X11R6/include --with-x-libraries=/usr/X11R6/lib
--enable-shared --enable-static --with-gnu-as --with-gnu-ld --with-stabs
--enable-threads=posix --enable-version-specific-runtime-libs --disable-coverage
--enable-gather-detailed-mem-stats --disable-libgcj --disable-checking
--enable-multilib --with-x --enable-cmath --enable-libstdcxx-debug
--enable-fast-character --enable-hash-synchronization --with-system-zlib
--with-libbanshee --with-demangler-in-ld --with-arch=athlon-xp --enable-libada
--enable-languages=c,c++,f95,objc,ada
Thread model: posix
gcc version 4.0.0 20050107 (experimental)
$
-----------------------------------------

gives

-----------------------------------------
test.c: In function 'f':
test.c:7: error: unrecognizable insn:
(insn 69 68 70 6 (set (reg:V4SI 94)
        (vec_concat:V4SF (mem:V2SF (reg:SI 64 [ ivtmp.66 ]) [0 S8 A8])
            (vec_select:V2SF (reg:V4SI 94)
                (parallel [
                        (const_int 2 [0x2])
                        (const_int 3 [0x3])
                    ])))) -1 (insn_list:REG_DEP_TRUE 68 (nil))
    (nil))
test.c:7: internal compiler error: in extract_insn, at recog.c:2020
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
-----------------------------------------

Works on x86_64 arch. (compiled by the native gcc compiled from the same sources
as the one mentioned above).
Comment 1 Andrew Pinski 2005-01-09 21:26:45 UTC
I get a different error with today's compiler but that is because I am not compiling with --disable-
checking.
t.c:7: internal compiler error: in simplify_binary_operation, at simplify-rtx.c:2178

WTF:
(set (reg:V4SI 94)
        (vec_concat:V4SF (mem:V2SF (reg:SI 64 [ ivtmp.66 ]) [0 S8 A8])
            (vec_select:V2SF (reg:V4SI 94)
                (parallel [
                        (const_int 2 [0x2])
                        (const_int 3 [0x3])
                    ]))))

Which comes from the expansion of 
;; *(vect_p.22 + (vector int *) D.1440 * 16B - 16B) = M*ivtmp.66{misalignment: 0}
Comment 2 CVS Commits 2005-01-20 10:16:39 UTC
Subject: Bug 19350

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2005-01-20 10:15:15

Modified files:
	gcc            : ChangeLog 
	gcc/config/i386: i386.c 

Log message:
	PR target/19350
	* config/i386/i386.c (ix86_expand_vector_move_misalign): Convert
	to V4SFmode in SSE1 fallback load path.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7197&r2=2.7198
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&r1=1.784&r2=1.785

Comment 3 Richard Henderson 2005-01-20 10:17:53 UTC
Fixed.