From c17ee676e55b86d2c9d61b569a8c7e0cd8fb6d4c Mon Sep 17 00:00:00 2001 From: Francois-Xavier Coudert Date: Fri, 29 Feb 2008 23:01:22 +0100 Subject: [PATCH] fold-const.c (fold_convertible_p): Correct the logic to follow that in fold_convert(). * fold-const.c (fold_convertible_p): Correct the logic to follow that in fold_convert(). From-SVN: r132780 --- gcc/ChangeLog | 5 +++++ gcc/fold-const.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 32be0ddd1e9..e6f51daf612 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-02-29 Francois-Xavier Coudert + + * fold-const.c (fold_convertible_p): Correct the logic to follow + that in fold_convert(). + 2008-02-29 Douglas Gregor PR c++/35315 diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 987acf1649c..5af6f0d686a 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2475,8 +2475,15 @@ fold_convertible_p (const_tree type, const_tree arg) return (TREE_CODE (orig) == VECTOR_TYPE && tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig))); - default: + case REAL_TYPE: + case FIXED_POINT_TYPE: + case COMPLEX_TYPE: + case VECTOR_TYPE: + case VOID_TYPE: return TREE_CODE (type) == TREE_CODE (orig); + + default: + return false; } } -- 2.30.2