re PR tree-optimization/57051 (Optimization regression in 4.8.0 from 4.7.2)

PR tree-optimization/57051
	* fold-const.c (const_binop) <case VEC_LSHIFT_EXPR,
	case VEC_RSHIFT_EXPR>: Fix BYTES_BIG_ENDIAN handling.

From-SVN: r199002
This commit is contained in:
Jakub Jelinek 2013-05-17 10:31:32 +02:00 committed by Jakub Jelinek
parent 17b962bd33
commit 52d8441318
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2013-05-17 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/57051
* fold-const.c (const_binop) <case VEC_LSHIFT_EXPR,
case VEC_RSHIFT_EXPR>: Fix BYTES_BIG_ENDIAN handling.
2013-05-16 Nick Clifton <nickc@redhat.com>
* config/rl78/rl78.c (rl78_attribute_table): Add naked.

View file

@ -1393,7 +1393,11 @@ const_binop (enum tree_code code, tree arg1, tree arg2)
if (shiftc >= outerc || (shiftc % innerc) != 0)
return NULL_TREE;
int offset = shiftc / innerc;
if (code == VEC_LSHIFT_EXPR)
/* The direction of VEC_[LR]SHIFT_EXPR is endian dependent.
For reductions, compiler emits VEC_RSHIFT_EXPR always,
for !BYTES_BIG_ENDIAN picks first vector element, but
for BYTES_BIG_ENDIAN last element from the vector. */
if ((code == VEC_RSHIFT_EXPR) ^ (!BYTES_BIG_ENDIAN))
offset = -offset;
tree zero = build_zero_cst (TREE_TYPE (type));
for (i = 0; i < count; i++)