Commit d362ac6c by Richard Biener Committed by Richard Biener

re PR tree-optimization/82285 (Optimizing error when using enumeration)

2017-09-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82285
	* tree-vect-patterns.c (vect_recog_bool_pattern): Also handle
	enumeral types.

	* gcc.dg/torture/pr82285.c: New testcase.

From-SVN: r253146
parent fb202364
2017-09-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/82285
* tree-vect-patterns.c (vect_recog_bool_pattern): Also handle
enumeral types.
2017-09-25 Tom de Vries <tom@codesourcery.com>
PR target/80035
2017-09-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/82285
* gcc.dg/torture/pr82285.c: New testcase.
2017-09-25 Justin Squirek <squirek@adacore.com>
* gnat.dg/entry_family.adb: New testcase
......
/* { dg-do run } */
enum tst { first = 0, second = 1 };
int
main ()
{
enum tst data[16];
for (unsigned i = 0; i < 16; i++)
data[i] = (i < 5 ? second : first);
if (data[2] != second)
__builtin_abort ();
return 0;
}
......@@ -3643,7 +3643,7 @@ vect_recog_bool_pattern (vec<gimple *> *stmts, tree *type_in,
rhs_code = gimple_assign_rhs_code (last_stmt);
if (CONVERT_EXPR_CODE_P (rhs_code))
{
if (TREE_CODE (TREE_TYPE (lhs)) != INTEGER_TYPE
if (! INTEGRAL_TYPE_P (TREE_TYPE (lhs))
|| TYPE_PRECISION (TREE_TYPE (lhs)) == 1)
return NULL;
vectype = get_vectype_for_scalar_type (TREE_TYPE (lhs));
......
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