Andrew Pinski <pinskia@gcc.gnu.org>
PR c++/27084
* cp-objcp-common.c (cxx_types_compatible_p): Ignore
top level qualifiers for pointer type comparisons.
* g++.dg/tree-ssa/copyprop-1.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115200
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-07-05 Richard Guenther <rguenther@suse.de>
+ Andrew Pinski <pinskia@gcc.gnu.org>
+
+ PR c++/27084
+ * cp-objcp-common.c (cxx_types_compatible_p): Ignore
+ top level qualifiers for pointer type comparisons.
+
2006-07-01 Jason Merrill <jason@redhat.com>
PR c++/28215
if (POINTER_TYPE_P (x) && POINTER_TYPE_P (y)
&& TYPE_MODE (x) == TYPE_MODE (y)
&& TYPE_REF_CAN_ALIAS_ALL (x) == TYPE_REF_CAN_ALIAS_ALL (y)
- && same_type_p (TREE_TYPE (x), TREE_TYPE (y)))
+ && same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (x),
+ TREE_TYPE (y)))
return 1;
return 0;
+2006-07-05 Richard Guenther <rguenther@suse.de>
+ Andrew Pinski <pinskia@gcc.gnu.org>
+
+ PR c++/27084
+ * g++.dg/tree-ssa/copyprop-1.C: New testcase.
+
2006-07-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28174
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-dce2" } */
+
+/* Verify that we can eliminate the useless conversions to/from
+ const qualified pointer types
+ this_2 = o_1;
+ D.20003_4 = this_2->data_m;
+ this_5 = D.20003_4;
+ D.20005_6 = this_5->value;
+ copyprop should propagate o_1 and D.20003_4 to the loads of data_m
+ and value. dce removes all traces of this. */
+
+struct Data {
+ int get() const { return value; }
+ int value;
+};
+
+struct Object {
+ int operator[](int i) const { return data_m->get(); }
+ Data *data_m;
+};
+
+int foo(Object&o)
+{
+ return o[0];
+}
+
+/* { dg-final { scan-tree-dump-not ".* = \[^>;\]*;" "dce2" } } */
+/* { dg-final { cleanup-tree-dump "dce2" } } */