This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/32882] Mismatched types with pointer to member functions and -fstrict-aliasing
- 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: 25 Jul 2007 13:48:53 -0000
- Subject: [Bug c++/32882] Mismatched types with pointer to member functions and -fstrict-aliasing
- References: <bug-32882-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from rguenth at gcc dot gnu dot org 2007-07-25 13:48 -------
With -fstrict-aliasing we claim the conversion is neccessary because the
pointed
to alias sets of the two pointers are different. For -fno-strict-aliasing the
frontend later says via the langhook that the two structures are compatible.
Now, both pointer-to-member function structures get assigned alias set zero
anyway from cxx_get_alias_set, but pointers to such structures get their
own alias set.
Index: cp-objcp-common.c
===================================================================
--- cp-objcp-common.c (revision 126911)
+++ cp-objcp-common.c (working copy)
@@ -45,7 +45,9 @@ cxx_get_alias_set (tree t)
return get_alias_set (TYPE_CONTEXT (t));
/* Punt on PMFs until we canonicalize functions properly. */
- if (TYPE_PTRMEMFUNC_P (t))
+ if (TYPE_PTRMEMFUNC_P (t)
+ || (POINTER_TYPE_P (t)
+ && TYPE_PTRMEMFUNC_P (TREE_TYPE (t))))
return 0;
return c_common_get_alias_set (t);
get's this case "working". Of course it may be time to "canonicalize
functions properly".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32882