diff options
author | Richard Guenther <rguenther@suse.de> | 2006-05-27 15:57:36 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2006-05-27 15:57:36 +0000 |
commit | 9e030af961640cc58c425da99fe98397549d5086 (patch) | |
tree | 5a69262c3b046bdf7d18dfb4631164564a727268 /gcc/fold-const.c | |
parent | f7b985802814f02cfe92e7187dcf17a40c046d27 (diff) | |
download | gcc-9e030af961640cc58c425da99fe98397549d5086.zip gcc-9e030af961640cc58c425da99fe98397549d5086.tar.gz gcc-9e030af961640cc58c425da99fe98397549d5086.tar.bz2 |
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
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index a5e57b1..7ef0fa1 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -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; |