Bug 18536 - ICE: in emit_move_insn, at expr.c:2590 with -ftree-vectorize -msse2
Summary: ICE: in emit_move_insn, at expr.c:2590 with -ftree-vectorize -msse2
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
Keywords: ice-on-valid-code, monitored, patch
Depends on:
Reported: 2004-11-18 01:30 UTC by Ferdinand
Modified: 2004-11-22 18:07 UTC (History)
3 users (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: 2004-11-18 01:52:04


Note You need to log in before you can comment on or make changes to this bug.
Description Ferdinand 2004-11-18 01:30:46 UTC
/tmp/gcc4/libexec/gcc/i686-pc-linux-gnu/4.0.0/cc1 -quiet test.c -quiet -dumpbase
test.c -msse2 -auxbase test -O -ftree-vectorize -o test.s -version             
GNU C version 4.0.0 20041117 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.0.0 2004117 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
test.c: In function 'foo':
test.c:4: internal compiler error: in emit_move_insn, at expr.c:2590

Configured with: ../configure --prefix=/tmp/gcc4 --enable-shared
--enable-languages=c --disable-nls --disable-libmudflap


void foo(a, b)
short     a;
short   * b;
        while (++a < 4) *b++ = 0;

Comment 1 Andrew Pinski 2004-11-18 01:52:03 UTC
Confirmed,  the problem I think is the same as the PPC64 problem in PR 18403 but I did not check the 
patch which will fix that one for sure.

Breakpoint 1, fancy_abort (file=0x81fcb4 "/Users/pinskia/src/apple-ppc-branch/gcc/gcc/expr.c", 
line=2485, function=0x81fe9c "emit_move_insn") at /Users/pinskia/src/apple-ppc-branch/gcc/gcc/
586       internal_error ("in %s, at %s:%d", function, trim_filename (file), line);
(gdb) up
#1  0x00337a2c in emit_move_insn (x=0x4178d7d0, y=0x417b1c48) at /Users/pinskia/src/apple-
2485                  && (GET_MODE (y) == mode || GET_MODE (y) == VOIDmode));
(gdb) l
2480      enum machine_mode mode = GET_MODE (x);
2481      rtx y_cst = NULL_RTX;
2482      rtx last_insn, set;
2484      gcc_assert (mode != BLKmode
2485                  && (GET_MODE (y) == mode || GET_MODE (y) == VOIDmode));
2487      if (CONSTANT_P (y))
2488        {
2489          if (optimize
(gdb) p debug_rtx(x)
(reg:SI 161 [ iters.6 ])
$1 = void
(gdb) p debug_rtx(y)
(subreg/s/u:HI (reg:SI 163 [ niters.1 ]) 2)
Comment 2 Dorit Naishlos 2004-11-18 14:33:51 UTC
(In reply to comment #1)
> Confirmed,  the problem I think is the same as the PPC64 problem in PR 18403 
but I did not check the 
> patch which will fix that one for sure.

That patch does not fix this problem - this is a type mismatch in a different 
place than the one in PR18403. I have a fix for this problem - I'll send a 
patch shortly.
Comment 3 Dorit Naishlos 2004-11-18 21:12:26 UTC
Comment 4 CVS Commits 2004-11-22 13:55:29 UTC
Subject: Bug 18536

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dorit@gcc.gnu.org	2004-11-22 13:55:05

Modified files:
	gcc            : ChangeLog tree-vectorizer.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg/vect: pr18536.c 

Log message:
	PR tree-opt/18536
	* tree-vectorizer.c (make_loop_iterate_ntimes): Use type of niters when
	creating iv instead of integer_type.
	(vect_build_loop_niters): Remove redundant code.
	(vect_transform_loop_bound): Removed (duplicates functionality of
	(vect_gen_niters_for_prolog_loop): Add documentation. Call
	lang_hooks.types.type_for_size to create a type of the required size.
	Use that type instead of integer_type. Remove redundant code.
	(vect_update_niters_after_peeling): Use type of niters instead of
	(vect_transform_loop): Unify handling of known and unknown loop bound
	cases. Call make_loop_iterate_ntimes instead of


Comment 5 Andrew Pinski 2004-11-22 18:07:26 UTC