------- Additional Comments From dorit at il dot ibm dot com 2005-03-14 20:01 ------- The problem is that we take the size_type of a void type, and pass null to fold_convert in vect_analyze_pointer_ref_access. So one thing to do is to make sure that we're dealing with a complete type:
*************** vect_analyze_pointer_ref_access (tree me *** 1321,1326 **** --- 1403,1416 ---- *ptr_step = fold_convert (ssizetype, step); innertype = TREE_TYPE (reftype); + if (!COMPLETE_TYPE_P (innertype)) + { + if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS, + LOOP_LOC (loop_vinfo))) + fprintf (vect_dump, "not vectorized: pointer to incomplete type."); + return NULL; + } + /* Check that STEP is a multiple of type size. */ if (!integer_zerop (size_binop (TRUNC_MOD_EXPR, *ptr_step, fold_convert (ssizetype, TYPE_SIZE_UNIT (innertype))))) This solves the ICE, but I noticed that we're actually looking at the wrong type - we're interested in the type of the data-reference, not the type of its 'init'. The following is what we want (also solves the ICE): *************** vect_analyze_pointer_ref_access (tree me *** 1310,1317 **** return NULL; } ! reftype = TREE_TYPE (init); ! if (!POINTER_TYPE_P (reftype)) { if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS, LOOP_LOC (loop_vinfo))) --- 1393,1399 ---- return NULL; } ! if (!POINTER_TYPE_P (TREE_TYPE (init))) { if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS, LOOP_LOC (loop_vinfo))) I'll bootstrap/test and submit. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20474