Bug 22480 - [4.1 Regression] ICE in convert_move, at expr.c:390 with -ftree-vectorize
Summary: [4.1 Regression] ICE in convert_move, at expr.c:390 with -ftree-vectorize
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code, monitored
: 21234 23595 23808 (view as bug list)
Depends on:
Blocks: 21468 33369
  Show dependency treegraph
 
Reported: 2005-07-14 10:06 UTC by Michael Cieslinski
Modified: 2007-09-10 06:32 UTC (History)
6 users (show)

See Also:
Host:
Target: x86_64-*,i?686-*
Build:
Known to work: 4.0.1
Known to fail: 4.1.0
Last reconfirmed: 2005-07-15 01:37:37


Attachments
preprocessed source (165.98 KB, text/plain)
2005-07-14 10:08 UTC, Michael Cieslinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Cieslinski 2005-07-14 10:06:53 UTC
When I compile qt334 with the actual snapshot of gcc41 I get an ICE when I 
enable autovectorisation.

Michael Cieslinski


g++41f -c -O2 -ftree-vectorize -o qimage.o qimage.ii
kernel/qimage.cpp: In function 'bool convert_32_to_8(const QImage*, QImage*, 
int, QRgb*, int)':
kernel/qimage.cpp:1489: internal compiler error: in convert_move, at expr.c:390
Please submit a full bug report, with preprocessed source if appropriate.


g++41f -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.1-20050709/configure --prefix=/usr/local/gcc41f
 --program-suffix=41f --with-arch=opteron --enable-languages=c,c++
 --enable-checking 
Thread model: posix
gcc version 4.1.0 20050709 (experimental)
Comment 1 Michael Cieslinski 2005-07-14 10:08:42 UTC
Created attachment 9266 [details]
preprocessed source
Comment 2 Michael Cieslinski 2005-07-14 10:14:32 UTC
This ICE occurs first with snapshot 20050417, snapshot 20050410 does not ICE
Comment 3 Andrew Pinski 2005-07-14 13:55:46 UTC
This is most likely a type mismatch.
Comment 4 Andrew Pinski 2005-07-15 01:37:37 UTC
Confirmed, reduced testcase:
void convert_32_to_8(void)
{
  static unsigned bm[16];
  int j;
  for (j=0; j<16;j++)
    bm[j]<<=8;
}
Comment 5 Andrew Pinski 2005-07-15 01:39:16 UTC
This is even reproducible on x86 with -O1 -msse2
Comment 6 Andrew Pinski 2005-07-22 18:59:59 UTC
Nope the types are correct.  The bug is in the middle-end when expanding VECTOR << VECTOR.
Comment 7 Paolo Bonzini 2005-07-28 07:11:55 UTC
No, the bug is in the vectorizer that produces a LSHIFT_EXPR rather than a
VEC_LSHIFT_EXPR.  There must have been problems committing the patch. :-(

Paolo
Comment 8 Paolo Bonzini 2005-07-28 08:20:11 UTC
Not even that... the backend for i386 accepts an SI, not a V4SI, as the shift
count.  This upsets the expander noticeably.
Comment 9 Volker Reichelt 2005-08-03 14:35:24 UTC
*** Bug 21234 has been marked as a duplicate of this bug. ***
Comment 10 Michael Cieslinski 2005-08-22 09:03:35 UTC
This ICE is still present with the actual snapshot (20050819)
Comment 11 Andrew Pinski 2005-08-27 15:08:02 UTC
*** Bug 23595 has been marked as a duplicate of this bug. ***
Comment 12 Andrew Pinski 2005-09-10 16:31:04 UTC
*** Bug 23808 has been marked as a duplicate of this bug. ***
Comment 13 Andrew Pinski 2005-09-10 16:32:03 UTC
This causes a build failure if you turn on -ftree-vectorize when building the target libraries.
Comment 14 GCC Commits 2005-09-14 09:27:24 UTC
Subject: Bug 22480

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dorit@gcc.gnu.org	2005-09-14 09:27:02

Modified files:
	gcc            : ChangeLog Makefile.in tree-vect-transform.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg/vect: pr22480.c 

Log message:
	2005-09-14  Uros Bizjak  <uros@kss-loka.si>
	
	PR middle-end/22480
	* tree-vect-transform.c (vectorizable_operation): Return false for
	scalar shift operations and for vector shift operations with
	non-invariant shift arguments.  Use scalar tree operand op1 as
	a shift operand when vector shift insn pattern uses scalar shift
	operand.
	* Makefile.in (tree-vect-transform.o): Depend on recog.h.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9953&r2=2.9954
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/Makefile.in.diff?cvsroot=gcc&r1=1.1540&r2=1.1541
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-vect-transform.c.diff?cvsroot=gcc&r1=2.43&r2=2.44
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6063&r2=1.6064
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/vect/pr22480.c.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 15 Andrew Pinski 2005-09-14 14:46:45 UTC
Fixed.
Comment 16 Richard Henderson 2005-12-02 17:45:07 UTC
Subject: Bug 22480

Author: rth
Date: Fri Dec  2 17:45:02 2005
New Revision: 107910

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107910
Log:
2005-09-14  Uros Bizjak  <uros@kss-loka.si>

        PR middle-end/22480
        * tree-vect-transform.c (vectorizable_operation): Return false for
        scalar shift operations and for vector shift operations with
        non-invariant shift arguments.  Use scalar tree operand op1 as
        a shift operand when vector shift insn pattern uses scalar shift
        operand.
        * Makefile.in (tree-vect-transform.o): Depend on recog.h.

Modified:
    branches/autovect-branch/gcc/ChangeLog
    branches/autovect-branch/gcc/Makefile.in
    branches/autovect-branch/gcc/tree-vect-transform.c