diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-07-18 23:02:49 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-07-18 23:02:49 +0000 |
commit | 7cf60649b25502849faecc6041082d464b881fac (patch) | |
tree | b5ab00a485b8808fc97b5299212b6bc8c9e9f0d5 /gcc/fold-const.c | |
parent | afaa5845faa57591b2a8634461a6630e8b334256 (diff) | |
download | gcc-7cf60649b25502849faecc6041082d464b881fac.tar.gz |
(fold, case CONVERT_EXPR): Don't merge conversions if outer is to
handle a type with differing precision.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@10145 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 4c86dac094d..8c35dc49bfc 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3445,11 +3445,14 @@ fold (expr) float or both integer, we don't need the middle conversion if it is wider than the final type and doesn't change the signedness (for integers). Avoid this if the final type is a pointer - since then we sometimes need the inner conversion. */ + since then we sometimes need the inner conversion. Likewise if + the outer has a precision not equal to the size of its mode. */ if ((((inter_int || inter_ptr) && (inside_int || inside_ptr)) || (inter_float && inside_float)) && inter_prec >= inside_prec && (inter_float || inter_unsignedp == inside_unsignedp) + && ! (final_prec != GET_MODE_BITSIZE (TYPE_MODE (final_type)) + && TYPE_MODE (final_type) == TYPE_MODE (inter_type)) && ! final_ptr) return convert (final_type, TREE_OPERAND (TREE_OPERAND (t, 0), 0)); @@ -3471,7 +3474,10 @@ fold (expr) && ((inter_unsignedp && inter_prec > inside_prec) == (final_unsignedp && final_prec > inter_prec)) && ! (inside_ptr && inter_prec != final_prec) - && ! (final_ptr && inside_prec != inter_prec)) + && ! (final_ptr && inside_prec != inter_prec) + && ! (final_prec != GET_MODE_BITSIZE (TYPE_MODE (final_type)) + && TYPE_MODE (final_type) == TYPE_MODE (inter_type)) + && ! final_ptr) return convert (final_type, TREE_OPERAND (TREE_OPERAND (t, 0), 0)); } |