Comment 0 for bug 960274

Revision history for this message
mickael guene (mickael-guene) wrote :

 Compiler crash when compiling small.c file with following options:
I'm using 4.6-2012.03 release.
gcc -c small.c -msoft-float -march=armv7-a -mfloat-abi=softfp -mfpu=neon -mvectorize-with-neon-quad -ftree-vectorize -O2

 It appear that problem is due to the fact that we deference random pointer. This is due to the fact that in vectorizable_type_promotion() in case of slp and with code == WIDEN_LSHIFT_EXPR no operand is push into vec_oprnds1.

 Below patch fix this problem but then we have crash later on.

--- sources/gcc/tree-vect-stmts.c 2012-03-12 12:31:42.000000000 +0100
+++ sources.patch/gcc/tree-vect-stmts.c 2012-03-20 15:14:28.000000000 +0100
@@ -3586,7 +3586,7 @@
     /* Store vec_oprnd1 for every vector stmt to be created
        for SLP_NODE. We check during the analysis that all
        the shift arguments are the same. */
- for (k = 0; k < slp_node->vec_stmts_size - 1; k++)
+ for (k = 0; k < slp_node->vec_stmts_size; k++)
                     VEC_quick_push (tree, vec_oprnds1, vec_oprnd1);

         vect_get_vec_defs (op0, NULL_TREE, stmt, &vec_oprnds0, NULL,