summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils2.c
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-02 10:59:32 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-02 10:59:32 +0000
commita10d3a24987eb64513e312445758385f69f39cb3 (patch)
tree52a6e66a285b54a02a7555a6e7d81b48214a6807 /gcc/ada/gcc-interface/utils2.c
parente4b5ff5f56becfea59fdd6330ba524c48cf1b96d (diff)
2015-03-02 Pierre-Marie de Rodat <derodat@adacore.com>
* gcc-interface/utils.c (gnat_pushdecl): For non-artificial pointer types, preserve the original type and create copies just like the C front-end does. For artificial ones, do not define a name for the original type. (create_type_decl): When gnat_pushdecl made the input type the original type for the new declaration, do not define a stub declaration for it. * gcc-interface/utils2.c (build_binary_op): Accept two different pointer types when they point to the same type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221108 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/utils2.c')
-rw-r--r--gcc/ada/gcc-interface/utils2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index a5fb3e2c0d92..e04add97d085 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -1062,6 +1062,13 @@ build_binary_op (enum tree_code op_code, tree result_type,
gcc_unreachable ();
}
+ else if (POINTER_TYPE_P (left_base_type)
+ && POINTER_TYPE_P (right_base_type))
+ {
+ gcc_assert (TREE_TYPE (left_base_type)
+ == TREE_TYPE (right_base_type));
+ best_type = left_base_type;
+ }
else
gcc_unreachable ();