diff options
author | Joseph Myers <joseph@codesourcery.com> | 2008-10-28 12:10:18 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2008-10-28 12:10:18 +0000 |
commit | 93c7979ec40ce84d1b9b37122c8ae75cd6cefe1f (patch) | |
tree | 3efd18f0ac8dd5189ad0d10eb497d249ab2083a4 /gcc/convert.c | |
parent | 2b73df0b1ffad29c60b5742f919a06b8a3af693d (diff) |
* convert.c (strip_float_extensions): Do not remove or introduce
conversions between binary and decimal floating-point types.
testsuite:
* gcc.dg/dfp/convert-bfp-12.c: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@141407 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/convert.c')
-rw-r--r-- | gcc/convert.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/convert.c b/gcc/convert.c index 0fef3a2e746..24617728298 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -81,7 +81,7 @@ strip_float_extensions (tree exp) it properly and handle it like (type)(narrowest_type)constant. This way we can optimize for instance a=a*2.0 where "a" is float but 2.0 is double constant. */ - if (TREE_CODE (exp) == REAL_CST) + if (TREE_CODE (exp) == REAL_CST && !DECIMAL_FLOAT_TYPE_P (TREE_TYPE (exp))) { REAL_VALUE_TYPE orig; tree type = NULL; @@ -108,6 +108,9 @@ strip_float_extensions (tree exp) if (!FLOAT_TYPE_P (subt)) return exp; + if (DECIMAL_FLOAT_TYPE_P (expt) != DECIMAL_FLOAT_TYPE_P (subt)) + return exp; + if (TYPE_PRECISION (subt) > TYPE_PRECISION (expt)) return exp; |