diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2019-01-20 12:55:38 +0000 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gcc.gnu.org> | 2019-01-20 12:55:38 +0000 |
commit | 5bdebb51a649d04569324f4f1124d5e64a3cbff7 (patch) | |
tree | 420e7c58ae557015dac5d880c91f9f924489f3aa /gcc/d/expr.cc | |
parent | 70d87497e760dca94ef78e4e936f6d461f36e80d (diff) | |
download | gcc-5bdebb51a649d04569324f4f1124d5e64a3cbff7.zip gcc-5bdebb51a649d04569324f4f1124d5e64a3cbff7.tar.gz gcc-5bdebb51a649d04569324f4f1124d5e64a3cbff7.tar.bz2 |
[D] Fix identity comparison for structs with complex float fields.
gcc/d/ChangeLog:
2019-01-20 Iain Buclaw <ibuclaw@gdcproject.org>
* d-codegen.cc (identity_compare_p): Return false if seen built-in
type with padding.
(build_float_identity): Moved here from expr.cc.
(lower_struct_comparison): Handle real and complex types.
* d-tree.h (build_float_identity): New.
* expr.cc (build_float_identity): Move to d-codegen.cc.
gcc/testsuite/ChangeLog:
2019-01-20 Iain Buclaw <ibuclaw@gdcproject.org>
* gdc.dg/runnable.d: Add more tests for comparing complex types.
From-SVN: r268104
Diffstat (limited to 'gcc/d/expr.cc')
-rw-r--r-- | gcc/d/expr.cc | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc index a1f7c26..4bfdde5 100644 --- a/gcc/d/expr.cc +++ b/gcc/d/expr.cc @@ -43,20 +43,6 @@ along with GCC; see the file COPYING3. If not see #include "d-tree.h" -/* Build a floating-point identity comparison between T1 and T2, ignoring any - excessive padding in the type. CODE is EQ_EXPR or NE_EXPR comparison. */ - -static tree -build_float_identity (tree_code code, tree t1, tree t2) -{ - tree tmemcmp = builtin_decl_explicit (BUILT_IN_MEMCMP); - tree size = size_int (TYPE_PRECISION (TREE_TYPE (t1)) / BITS_PER_UNIT); - - tree result = build_call_expr (tmemcmp, 3, build_address (t1), - build_address (t2), size); - return build_boolop (code, result, integer_zero_node); -} - /* Implements the visitor interface to build the GCC trees of all Expression AST classes emitted from the D Front-end. All visit methods accept one parameter E, which holds the frontend AST |