From 5bdebb51a649d04569324f4f1124d5e64a3cbff7 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Sun, 20 Jan 2019 12:55:38 +0000 Subject: [D] Fix identity comparison for structs with complex float fields. gcc/d/ChangeLog: 2019-01-20 Iain Buclaw * 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 * gdc.dg/runnable.d: Add more tests for comparing complex types. From-SVN: r268104 --- gcc/d/expr.cc | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'gcc/d/expr.cc') 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 -- cgit v1.1