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
This commit is contained in:
parent
f5d9895a06
commit
1d719415f5
@ -1,5 +1,9 @@
|
||||
2003-03-09 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/9373
|
||||
* cp-lang.c (cxx_get_alias_set): Use alias set zero for
|
||||
pointers to member functions.
|
||||
|
||||
PR c++/8534
|
||||
* decl.c (build_ptrmemfunc_type): Do not allow default arugments
|
||||
in pointer-to-member-function types.
|
||||
|
@ -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);
|
||||
|
@ -1,5 +1,8 @@
|
||||
2003-03-09 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/9373
|
||||
* g++.dg/opt/ptrmem2.C: New test.
|
||||
|
||||
PR c++/8534
|
||||
* g++.dg/opt/ptrmem1.C: New test.
|
||||
|
||||
|
12
gcc/testsuite/g++.dg/opt/ptrmem2.C
Normal file
12
gcc/testsuite/g++.dg/opt/ptrmem2.C
Normal file
@ -0,0 +1,12 @@
|
||||
typedef unsigned int Mword;
|
||||
struct Thread
|
||||
{
|
||||
Mword sys_ipc_log();
|
||||
void hook_ipc_vector();
|
||||
unsigned (Thread::*syscall_table)();
|
||||
};
|
||||
|
||||
void Thread::hook_ipc_vector()
|
||||
{
|
||||
syscall_table = &Thread::sys_ipc_log;
|
||||
}
|
Loading…
Reference in New Issue
Block a user