re PR middle-end/27773 (ICE: in find_lattice_value, at tree-complex.c:133)

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

	PR middle-end/27773
	* fold-const.c (fold_plusminus_mult_expr): Use fold_convert
	to produce a constant of value 1 of generic type.

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

From-SVN: r114158
This commit is contained in:
Richard Guenther 2006-05-27 15:57:36 +00:00 committed by Richard Biener
parent f7b9858028
commit 9e030af961
4 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2006-05-27 Richard Guenther <rguenther@suse.de>
PR middle-end/27773
* fold-const.c (fold_plusminus_mult_expr): Use fold_convert
to produce a constant of value 1 of generic type.
2006-05-27 Dirk Mueller <dmueller@suse.de>
* cgraphunit.c (decide_is_function_needed): Fix wrong

View File

@ -6702,10 +6702,7 @@ fold_plusminus_mult_expr (enum tree_code code, tree type, tree arg0, tree arg1)
else
{
arg00 = arg0;
if (!FLOAT_TYPE_P (type))
arg01 = build_int_cst (type, 1);
else
arg01 = build_real (type, dconst1);
arg01 = fold_convert (type, integer_one_node);
}
if (TREE_CODE (arg1) == MULT_EXPR)
{
@ -6715,10 +6712,7 @@ fold_plusminus_mult_expr (enum tree_code code, tree type, tree arg0, tree arg1)
else
{
arg10 = arg1;
if (!FLOAT_TYPE_P (type))
arg11 = build_int_cst (type, 1);
else
arg11 = build_real (type, dconst1);
arg11 = fold_convert (type, integer_one_node);
}
same = NULL_TREE;

View File

@ -1,3 +1,8 @@
2006-05-27 Richard Guenther <rguenther@suse.de>
PR middle-end/27773
* gcc.dg/torture/pr27773.c: New testcase.
2006-05-27 Dirk Mueller <dmueller@suse.de>
* gcc.dg/pr24561.c: Rename to..

View File

@ -0,0 +1,6 @@
/* { dg-do compile } */
_Complex float f(_Complex float a, float b)
{
return a - a*b;
}