Bug 46049 - [4.6 Regression] ICE: in expand_widen_pattern_expr, at optabs.c:522 with -ftree-vectorize
Summary: [4.6 Regression] ICE: in expand_widen_pattern_expr, at optabs.c:522 with -ftr...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2010-10-16 15:17 UTC by Zdenek Sojka
Modified: 2010-10-21 13:44 UTC (History)
2 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work: 4.5.2
Known to fail: 4.6.0
Last reconfirmed: 2010-10-16 17:43:32


Attachments
reduced testcase (162 bytes, text/plain)
2010-10-16 15:17 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2010-10-16 15:17:49 UTC
Created attachment 22062 [details]
reduced testcase

The testcase crashes with two different ICEs, depending on supplied flags.

ICE 1:
$ gcc -O -ftree-vectorize pr46049.c  
pr46049.c: In function 'foo':
pr46049.c:9:6: internal compiler error: in expand_widen_pattern_expr, at optabs.c:522
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

ICE 2:
$ gcc -O -ftree-vectorize -ftree-pre pr46049.c 
pr46049.c: In function 'foo':
pr46049.c:18:1: error: unrecognizable insn:
(insn 62 61 63 6 (set (reg:V4SI 158)
        (vec_merge:V4SI (vec_duplicate:V4SI (reg/v:HI 152 [ x ]))
            (const_vector:V4SI [
                    (const_int 0 [0])
                    (const_int 0 [0])
                    (const_int 0 [0])
                    (const_int 0 [0])
                ])
            (const_int 1 [0x1]))) pr46049.c:11 -1
     (nil))
pr46049.c:18:1: internal compiler error: in extract_insn, at recog.c:2110
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested versions:
r165540 - crash (with PR45352 fix, but that affects only haifa scheduler)
r163636 - OK
Comment 1 H.J. Lu 2010-10-16 17:43:32 UTC
(In reply to comment #0)
> Created attachment 22062 [details]
> reduced testcase
> 
> The testcase crashes with two different ICEs, depending on supplied flags.
> 
> ICE 1:
> $ gcc -O -ftree-vectorize pr46049.c  
> pr46049.c: In function 'foo':
> pr46049.c:9:6: internal compiler error: in expand_widen_pattern_expr, at
> optabs.c:522
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
>
> ICE 2:
> $ gcc -O -ftree-vectorize -ftree-pre pr46049.c 
> pr46049.c: In function 'foo':
> pr46049.c:18:1: error: unrecognizable insn:
> (insn 62 61 63 6 (set (reg:V4SI 158)
>         (vec_merge:V4SI (vec_duplicate:V4SI (reg/v:HI 152 [ x ]))
>             (const_vector:V4SI [
>                     (const_int 0 [0])
>                     (const_int 0 [0])
>                     (const_int 0 [0])
>                     (const_int 0 [0])
>                 ])
>             (const_int 1 [0x1]))) pr46049.c:11 -1
>      (nil))
> pr46049.c:18:1: internal compiler error: in extract_insn, at recog.c:2110
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> 
> Tested versions:
> r165540 - crash (with PR45352 fix, but that affects only haifa scheduler)
> r163636 - OK

Both are caused by revision 165412:

http://gcc.gnu.org/ml/gcc-cvs/2010-10/msg00596.html
Comment 2 irar 2010-10-21 13:37:07 UTC
Author: irar
Date: Thu Oct 21 13:36:56 2010
New Revision: 165777

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165777
Log:

	PR tree-optimization/46049
	PR tree-optimization/46052
	* tree-vectorizer.h (enum stmt_vec_info_type): Add new value for
	shift.
	(vect_get_slp_defs): Add arguments.
	* tree-vect-loop.c (vect_create_epilog_for_reduction): Pass scalar
	operands to vect_get_slp_defs.
	(vectorizable_reduction): Fix comment, pass scalar operands to
	vect_get_slp_defs.
	* tree-vect-stmts.c (vect_get_vec_def_for_operand): Use operand's
	type to determine number of units in the created vector.
	(vect_get_vec_defs): Pass scalar operands to vect_get_slp_defs.
	(vectorizable_conversion): Fix comment.
	(vectorizable_shift): New function.
	(vectorizable_operation): Move code that handles shifts to
	vectorizable_shift.
	(vectorizable_type_demotion): Fix comment, pass scalar operands to
	vect_get_slp_defs.
	(vectorizable_type_promotion, vectorizable_store): Likewise.
	(vectorizable_condition): Fix comment.
	(vect_analyze_stmt): Call vectorizable_shift.
	(vect_transform_stmt): Likewise.
	* tree-vect-slp.c (vect_get_constant_vectors): Add new argument.
	Use it as the operand to create vectors for, except reduction
	initial definition and store.  Use operands type.
	(vect_get_slp_defs): Add new arguments.  Pass them to
	vect_get_constant_vectors.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr46049.c
    trunk/gcc/testsuite/gcc.dg/vect/pr46052.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-loop.c
    trunk/gcc/tree-vect-slp.c
    trunk/gcc/tree-vect-stmts.c
    trunk/gcc/tree-vectorizer.h
Comment 3 Ira Rosen 2010-10-21 13:44:32 UTC
Fixed.