From 02c52e944f67987d3e2a506e9e3e9c60282db7ae Mon Sep 17 00:00:00 2001 From: jsm28 Date: Wed, 29 Oct 2008 17:05:42 +0000 Subject: PR middle-end/36578 * convert.c (convert_to_real): Do not optimize conversions of binary arithmetic operations between binary and decimal floating-point types. Consider mode of target type in determining decimal type for arithmetic. Unless flag_unsafe_math_optimizations, do not optimize binary conversions where this may change rounding behavior. * real.c (real_can_shorten_arithmetic): New. * real.h (real_can_shorten_arithmetic): Declare. testsuite: * gcc.dg/dfp/convert-bfp-13.c, gcc.dg/dfp/convert-bfp-14.c, gcc.dg/dfp/convert-dfp-fold-2.c, gcc.target/i386/pr36578-1.c, gcc.target/i386/pr36578-2.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141432 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/real.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/real.h') diff --git a/gcc/real.h b/gcc/real.h index 44e79c36e17..5a686536608 100644 --- a/gcc/real.h +++ b/gcc/real.h @@ -438,6 +438,11 @@ extern rtx const_double_from_real_value (REAL_VALUE_TYPE, enum machine_mode); /* Replace R by 1/R in the given machine mode, if the result is exact. */ extern bool exact_real_inverse (enum machine_mode, REAL_VALUE_TYPE *); +/* Return true if arithmetic on values in IMODE that were promoted + from values in TMODE is equivalent to direct arithmetic on values + in TMODE. */ +bool real_can_shorten_arithmetic (enum machine_mode, enum machine_mode); + /* In tree.c: wrap up a REAL_VALUE_TYPE in a tree node. */ extern tree build_real (tree, REAL_VALUE_TYPE); -- cgit v1.2.1