This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/29286] [4.0/4.1/4.2/4.3 Regression] placement new does not change the dynamic type as it should
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 May 2007 09:47:54 -0000
- Subject: [Bug libstdc++/29286] [4.0/4.1/4.2/4.3 Regression] placement new does not change the dynamic type as it should
- References: <bug-29286-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #51 from rguenth at gcc dot gnu dot org 2007-05-12 10:47 -------
This looks indeed very promising. I'll give it a spin on tramp3d. The only
thing I noticed is that
+ case CHANGE_DYNAMIC_TYPE_EXPR:
+ /* We can access the location with the given type. We don't
+ track pointers in RTL, so we handle this by assuming that any
+ reference to one type can alias any reference to the other
+ type across the whole function. No code is generated. */
+ {
+ tree type = CHANGE_DYNAMIC_TYPE_NEW_TYPE (exp);
+ tree ptr = CHANGE_DYNAMIC_TYPE_LOCATION (exp);
+ tree ptr_type = TREE_TYPE (ptr);
+
+ gcc_assert (TREE_CODE (type) == POINTER_TYPE);
+ gcc_assert (TREE_CODE (ptr_type) == POINTER_TYPE);
+ merge_alias_sets_in_function (cfun,
+ get_alias_set (TREE_TYPE (type)),
+ get_alias_set (TREE_TYPE (ptr_type)));
+ return const0_rtx;
+ }
doesn't seem to handle the case the original pointed to type is not the old
dynamic type (which you rightfully were concerned about in comment #47). So
it looks like (in absence of points-to information) we need to make the
new dynamic type alias everything?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286