Commit bfccadc9 by Ilya Enkovich Committed by Ilya Enkovich

tree-vect-generic.c (expand_vector_operations_1): Check optab exists before use it.

gcc/

	* tree-vect-generic.c (expand_vector_operations_1): Check
	optab exists before use it.

gcc/testsuite/

	* g++.dg/pr68062.C: New test.

From-SVN: r229275
parent 486208e7
2015-10-23 Ilya Enkovich <enkovich.gnu@gmail.com> 2015-10-23 Ilya Enkovich <enkovich.gnu@gmail.com>
* tree-vect-generic.c (expand_vector_operations_1): Check
optab exists before use it.
2015-10-23 Ilya Enkovich <enkovich.gnu@gmail.com>
* tree-vect-generic.c (expand_vector_condition): Avoid * tree-vect-generic.c (expand_vector_condition): Avoid
uninitialized variable warning. uninitialized variable warning.
2015-10-23 Ilya Enkovich <enkovich.gnu@gmail.com>
* g++.dg/pr68062.C: New test.
2015-10-23 Jeff Law <law@redhat.com> 2015-10-23 Jeff Law <law@redhat.com>
PR tree-optimization/67830 PR tree-optimization/67830
......
/* { dg-do compile } */
/* { dg-options "-funsigned-char" } */
typedef char __attribute__ ((vector_size (4))) v4qi;
typedef unsigned char __attribute__ ((vector_size (4))) uv4qi;
v4qi v;
void ret(char a)
{
v4qi c={a,a,a,a};
uv4qi d={a,a,a,a};
v = (c!=d);
}
...@@ -1533,7 +1533,8 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi) ...@@ -1533,7 +1533,8 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
&& TYPE_MODE (TREE_TYPE (type)) == TYPE_MODE (TREE_TYPE (srhs1))) && TYPE_MODE (TREE_TYPE (type)) == TYPE_MODE (TREE_TYPE (srhs1)))
{ {
op = optab_for_tree_code (code, TREE_TYPE (type), optab_scalar); op = optab_for_tree_code (code, TREE_TYPE (type), optab_scalar);
if (optab_handler (op, TYPE_MODE (TREE_TYPE (type))) != CODE_FOR_nothing) if (op != unknown_optab
&& optab_handler (op, TYPE_MODE (TREE_TYPE (type))) != CODE_FOR_nothing)
{ {
tree slhs = make_ssa_name (TREE_TYPE (srhs1)); tree slhs = make_ssa_name (TREE_TYPE (srhs1));
gimple *repl = gimple_build_assign (slhs, code, srhs1, srhs2); gimple *repl = gimple_build_assign (slhs, code, srhs1, srhs2);
......
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