current SVN: /home/marcus/projects/gcc/BIN/bin/gcc -m32 -c -O3 -ftree-vectorize -msse3 dosmem.i dosmem.i: In function 'DOSMEM_FillIsrTable': dosmem.i:1: internal compiler error: in vectorizable_type_demotion, at tree-vect-transform.c:4098 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Created attachment 14181 [details] dosmem.i
Testing this patch (it's a bug in the fix for PR33301. I accidentally treated TYPE_SIZE_UNIT as a constant, whereas it's really a tree...): Index: tree-vect-analyze.c =================================================================== *** tree-vect-analyze.c (revision 128322) --- tree-vect-analyze.c (working copy) *************** vect_determine_vectorization_factor (loo *** 242,252 **** operation = GIMPLE_STMT_OPERAND (stmt, 1); if (TREE_CODE (operation) == NOP_EXPR || TREE_CODE (operation) == CONVERT_EXPR ! || TREE_CODE (operation) == WIDEN_MULT_EXPR) { tree rhs_type = TREE_TYPE (TREE_OPERAND (operation, 0)); ! if (TYPE_SIZE_UNIT (rhs_type) < TYPE_SIZE_UNIT (scalar_type)) ! scalar_type = TREE_TYPE (TREE_OPERAND (operation, 0)); } if (vect_print_dump_info (REPORT_DETAILS)) --- 242,253 ---- operation = GIMPLE_STMT_OPERAND (stmt, 1); if (TREE_CODE (operation) == NOP_EXPR || TREE_CODE (operation) == CONVERT_EXPR ! || TREE_CODE (operation) == WIDEN_MULT_EXPR) { tree rhs_type = TREE_TYPE (TREE_OPERAND (operation, 0)); ! if (TREE_INT_CST_LOW (TYPE_SIZE_UNIT (rhs_type)) < ! TREE_INT_CST_LOW (TYPE_SIZE_UNIT (scalar_type))) ! scalar_type = rhs_type; } if (vect_print_dump_info (REPORT_DETAILS))
Subject: Bug 33373 Author: dorit Date: Wed Sep 12 07:09:38 2007 New Revision: 128415 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128415 Log: PR tree-optimization/33373 * tree-vect-analyze (vect_determine_vectorization_factor): Call TREE_INT_CST_LOW when comparing TYPE_SIZE_UNIT. Added: trunk/gcc/testsuite/gcc.dg/vect/pr33373.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-analyze.c
Very similar testcase with the difference that it is not fixed by r128415 and makes current trunk segfault in VEC_tree_base_pop(): void f (unsigned int *d, unsigned int *s, int w) { int i; for (i = 0; i < w; ++i) d [i] = s [i] * (unsigned short) (~d [i] >> 24); }
(In reply to comment #4) > Very similar testcase with the difference that it is not fixed by r128415 and > makes current trunk segfault in VEC_tree_base_pop(): > void f (unsigned int *d, unsigned int *s, int w) > { > int i; > for (i = 0; i < w; ++i) > d [i] = s [i] * (unsigned short) (~d [i] >> 24); > } this should fix it: Index: tree-vect-transform.c =================================================================== *** tree-vect-transform.c (revision 128501) --- tree-vect-transform.c (working copy) *************** vect_get_vec_defs_for_stmt_copy (enum ve *** 1938,1944 **** vec_oprnd = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd); VEC_quick_push (tree, *vec_oprnds0, vec_oprnd); ! if (vec_oprnds1) { vec_oprnd = VEC_pop (tree, *vec_oprnds1); vec_oprnd = vect_get_vec_def_for_stmt_copy (dt[1], vec_oprnd); --- 1938,1944 ---- vec_oprnd = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd); VEC_quick_push (tree, *vec_oprnds0, vec_oprnd); ! if (vec_oprnds1 && *vec_oprnds1) { vec_oprnd = VEC_pop (tree, *vec_oprnds1); vec_oprnd = vect_get_vec_def_for_stmt_copy (dt[1], vec_oprnd); (and by the way, I think this is a totally different issue than what this PR was originally opened for, and should be a separate PR. I think this regression is due to r128289)
Fixed. http://gcc.gnu.org/viewcvs?view=rev&revision=128514