Commit 30a843c3 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/28162 (ICE in set_value_range, at tree-vrp.c:157)

2006-07-05  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/28162
	* fold-const.c (fold_binary): For (-A) * (-B) -> A * B
	make sure to convert the operands to the correct type.

	* gcc.dg/pr28162.c: New testcase.

From-SVN: r115202
parent e5d7f6f7
2006-07-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/28162
* fold-const.c (fold_binary): For (-A) * (-B) -> A * B
make sure to convert the operands to the correct type.
2006-07-04 Paolo Bonzini <bonzini@gnu.org> 2006-07-04 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/28218 PR tree-optimization/28218
......
...@@ -8852,12 +8852,12 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) ...@@ -8852,12 +8852,12 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
/* (-A) * (-B) -> A * B */ /* (-A) * (-B) -> A * B */
if (TREE_CODE (arg0) == NEGATE_EXPR && negate_expr_p (arg1)) if (TREE_CODE (arg0) == NEGATE_EXPR && negate_expr_p (arg1))
return fold_build2 (MULT_EXPR, type, return fold_build2 (MULT_EXPR, type,
TREE_OPERAND (arg0, 0), fold_convert (type, TREE_OPERAND (arg0, 0)),
negate_expr (arg1)); fold_convert (type, negate_expr (arg1)));
if (TREE_CODE (arg1) == NEGATE_EXPR && negate_expr_p (arg0)) if (TREE_CODE (arg1) == NEGATE_EXPR && negate_expr_p (arg0))
return fold_build2 (MULT_EXPR, type, return fold_build2 (MULT_EXPR, type,
negate_expr (arg0), fold_convert (type, negate_expr (arg0)),
TREE_OPERAND (arg1, 0)); fold_convert (type, TREE_OPERAND (arg1, 0)));
if (! FLOAT_TYPE_P (type)) if (! FLOAT_TYPE_P (type))
{ {
......
2006-07-05 Richard Guenther <rguenther@suse.de> 2006-07-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/28162
* gcc.dg/pr28162.c: New testcase.
2006-07-05 Richard Guenther <rguenther@suse.de>
Andrew Pinski <pinskia@gcc.gnu.org> Andrew Pinski <pinskia@gcc.gnu.org>
PR c++/27084 PR c++/27084
/* { dg-do compile } */
/* { dg-options "-O3" } */
void Lag_max_wght(float corr[], long wght_flg)
{
float t0, max;
const float *ww;
long i;
if ( wght_flg > 0 ) {
for ( i = 143; i >= 20; i-- ) {
t0 = corr[ - i] * *ww--;
if ( t0 >= max )
max = t0;
}
}
}
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