Commit 09b86855 by Richard Guenther Committed by Richard Biener

re PR middle-end/27084 (Does not propagate memory load base through useless type conversion)

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.

	* g++.dg/tree-ssa/copyprop-1.C: New testcase.

Co-Authored-By: Andrew Pinski <pinskia@gcc.gnu.org>

From-SVN: r115200
parent d898f3ce
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
......
......@@ -179,7 +179,8 @@ cxx_types_compatible_p (tree x, tree y)
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
/* { 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" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment