Commit b2d16a23 by Uros Bizjak Committed by Dorit Nuzman

re PR middle-end/22480 (ICE in convert_move, at expr.c:390 with -ftree-vectorize)

2005-09-14  Uros Bizjak  <uros@kss-loka.si>

        PR middle-end/22480
        * tree-vect-transform.c (vectorizable_operation): Return false for
        scalar shift operations and for vector shift operations with
        non-invariant shift arguments.  Use scalar tree operand op1 as
        a shift operand when vector shift insn pattern uses scalar shift
        operand.
        * Makefile.in (tree-vect-transform.o): Depend on recog.h.

From-SVN: r104264
parent 816fa80a
2005-09-14 Uros Bizjak <uros@kss-loka.si>
PR middle-end/22480
* tree-vect-transform.c (vectorizable_operation): Return false for
scalar shift operations and for vector shift operations with
non-invariant shift arguments. Use scalar tree operand op1 as
a shift operand when vector shift insn pattern uses scalar shift
operand.
* Makefile.in (tree-vect-transform.o): Depend on recog.h.
2005-09-14 Olivier Hainque <hainque@adacore.com>
* gimplify.c (gimplify_init_ctor_eval): Don't discard a zero-sized
......
......@@ -1959,7 +1959,7 @@ tree-vect-analyze.o: tree-vect-analyze.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) tree-chrec.h
tree-vect-transform.o: tree-vect-transform.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) \
coretypes.h $(TM_H) $(GGC_H) $(OPTABS_H) $(RECOG_H) $(TREE_H) $(RTL_H) \
$(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
$(TIMEVAR_H) $(CFGLOOP_H) $(TARGET_H) tree-pass.h $(EXPR_H) \
tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) langhooks.h toplev.h \
......
2005-09-14 Uros Bizjak <uros@kss-loka.si>
PR middle-end/22480
* gcc.dg/vect/pr22480.c: New test.
2005-09-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/19358
/* { dg-do compile } */
/* { dg-require-effective-target vect_int } */
void
test_1 (void)
{
static unsigned int bm[16];
int j;
for (j = 0; j < 16; j++)
bm[j] <<= 8;
}
void
test_2 (int a)
{
static unsigned int bm[16];
int j;
for (j = 0; j < 16; j++)
bm[j] <<= a;
}
void
test_3 (void)
{
static unsigned bm[16];
int am[16];
int j;
for (j = 0; j < 16;j++)
bm[j] <<= am[j];
}
......@@ -35,6 +35,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "cfgloop.h"
#include "expr.h"
#include "optabs.h"
#include "recog.h"
#include "tree-data-ref.h"
#include "tree-chrec.h"
#include "tree-scalar-evolution.h"
......@@ -1409,6 +1410,8 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
int op_type;
tree op;
optab optab;
int icode;
enum machine_mode optab_op2_mode;
tree def, def_stmt;
enum vect_def_type dt;
......@@ -1464,7 +1467,8 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
return false;
}
vec_mode = TYPE_MODE (vectype);
if (optab->handlers[(int) vec_mode].insn_code == CODE_FOR_nothing)
icode = (int) optab->handlers[(int) vec_mode].insn_code;
if (icode == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "op not supported by target.");
......@@ -1486,6 +1490,25 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
return false;
}
if (code == LSHIFT_EXPR || code == RSHIFT_EXPR)
{
/* FORNOW: not yet supported. */
if (!VECTOR_MODE_P (vec_mode))
return false;
/* Invariant argument is needed for a vector shift
by a scalar shift operand. */
optab_op2_mode = insn_data[icode].operand[2].mode;
if (! (VECTOR_MODE_P (optab_op2_mode)
|| dt == vect_constant_def
|| dt == vect_invariant_def))
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "operand mode requires invariant argument.");
return false;
}
}
if (!vec_stmt) /* transformation not required. */
{
STMT_VINFO_TYPE (stmt_info) = op_vec_info_type;
......@@ -1508,7 +1531,25 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
if (op_type == binary_op)
{
op1 = TREE_OPERAND (operation, 1);
vec_oprnd1 = vect_get_vec_def_for_operand (op1, stmt, NULL);
if (code == LSHIFT_EXPR || code == RSHIFT_EXPR)
{
/* Vector shl and shr insn patterns can be defined with
scalar operand 2 (shift operand). In this case, use
constant or loop invariant op1 directly, without
extending it to vector mode first. */
optab_op2_mode = insn_data[icode].operand[2].mode;
if (!VECTOR_MODE_P (optab_op2_mode))
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "operand 1 using scalar mode.");
vec_oprnd1 = op1;
}
}
if (!vec_oprnd1)
vec_oprnd1 = vect_get_vec_def_for_operand (op1, stmt, NULL);
}
/* Arguments are ready. create the new vector stmt. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment