diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1993-05-03 16:33:42 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1993-05-03 16:33:42 -0700 |
commit | f87550e01ba02eb63e3b691d422aed6a698ddf1c (patch) | |
tree | 06d700c0d667d40c468d6b4e1f403fdaec639401 | |
parent | 66b2ba11a63a3f210461d440fca565a836a25281 (diff) | |
download | gcc-f87550e01ba02eb63e3b691d422aed6a698ddf1c.zip gcc-f87550e01ba02eb63e3b691d422aed6a698ddf1c.tar.gz gcc-f87550e01ba02eb63e3b691d422aed6a698ddf1c.tar.bz2 |
(truthvalue_conversion): Don't optimize subtract of reals when target uses
IEEE arithmetic.
From-SVN: r4311
-rw-r--r-- | gcc/c-common.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index f4a966e..2847b0b 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1064,9 +1064,16 @@ truthvalue_conversion (expr) return truthvalue_conversion (TREE_OPERAND (expr, 0)); break; - case BIT_XOR_EXPR: case MINUS_EXPR: - /* These can be changed into a comparison of the two objects. */ + /* With IEEE arithmetic, x - x may not equal 0, so we can't optimize + this case. */ + if (TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT + && TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE) + break; + /* fall through... */ + case BIT_XOR_EXPR: + /* This and MINUR_EXPR can be changed into a comparison of the + two objects. */ if (TREE_TYPE (TREE_OPERAND (expr, 0)) == TREE_TYPE (TREE_OPERAND (expr, 1))) return build_binary_op (NE_EXPR, TREE_OPERAND (expr, 0), |