diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-03-10 07:26:34 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-03-10 07:26:34 +0000 |
commit | 1d719415f50716bb93edfafb789ee8d2fcf38bd1 (patch) | |
tree | a26c21de35f0a5274aeeaf713351a5bc07a214a1 /gcc/cp/cp-lang.c | |
parent | f5d9895a069ebee45e9f656c7083bbc5d671baf0 (diff) | |
download | gcc-1d719415f50716bb93edfafb789ee8d2fcf38bd1.zip gcc-1d719415f50716bb93edfafb789ee8d2fcf38bd1.tar.gz gcc-1d719415f50716bb93edfafb789ee8d2fcf38bd1.tar.bz2 |
re PR c++/9373 (ICE with -fstrict-aliasing in set_mem_alias_set, at emit-rtl.c:1932)
PR c++/9373
* g++.dg/opt/ptrmem2.C: New test.
PR c++/9373
* cp-lang.c (cxx_get_alias_set): Use alias set zero for
pointers to member functions.
From-SVN: r64070
Diffstat (limited to 'gcc/cp/cp-lang.c')
-rw-r--r-- | gcc/cp/cp-lang.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index 3671027..b35c31c 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -262,8 +262,14 @@ ok_to_generate_alias_set_for_type (tree t) static HOST_WIDE_INT cxx_get_alias_set (tree t) { - /* It's not yet safe to use alias sets for classes in C++. */ - if (!ok_to_generate_alias_set_for_type(t)) + + if (/* It's not yet safe to use alias sets for some classes in C++. */ + !ok_to_generate_alias_set_for_type (t) + /* Nor is it safe to use alias sets for pointers-to-member + functions, due to the fact that there may be more than one + RECORD_TYPE type corresponding to the same pointer-to-member + type. */ + || TYPE_PTRMEMFUNC_P (t)) return 0; return c_common_get_alias_set (t); |