diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/class.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/inherit/covariant7.C | 16 |
4 files changed, 19 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f2c7faa..54d0ef6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2010-09-10 Jan Hubicka <jh@suse.cz> + + PR tree-optimization/45605 + * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in ADDR_EXPR + 2010-09-08 Jakub Jelinek <jakub@redhat.com> PR c++/45588 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 35b6db13..4823fa2 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -7797,7 +7797,7 @@ build_vtbl_initializer (tree binfo, { fn = abort_fndecl; if (abort_fndecl_addr == NULL) - abort_fndecl_addr = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn); + abort_fndecl_addr = fold_convert (vfunc_ptr_type_node, build_fold_addr_expr (fn)); init = abort_fndecl_addr; } else @@ -7810,7 +7810,7 @@ build_vtbl_initializer (tree binfo, } /* Take the address of the function, considering it to be of an appropriate generic type. */ - init = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn); + init = fold_convert (vfunc_ptr_type_node, build_fold_addr_expr (fn)); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 32889aa..f9292f1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-09-10 Jan Hubicka <jh@suse.cz> + + * g++.dg/inherit/covariant7.C: Fix pattern matching. + 2010-09-10 Martin Jambor <mjambor@suse.cz> PR tree-optimization/44972 diff --git a/gcc/testsuite/g++.dg/inherit/covariant7.C b/gcc/testsuite/g++.dg/inherit/covariant7.C index 4d519ed..4f0c7f7 100644 --- a/gcc/testsuite/g++.dg/inherit/covariant7.C +++ b/gcc/testsuite/g++.dg/inherit/covariant7.C @@ -36,16 +36,16 @@ struct c6 : c0, c3, c4 // f2 appears four times in the c6 vtables: // once in c1-in-c3-in-c6 - covariant, virtual base, uses c1 vcall offset and c0 vbase offset -// { dg-final { scan-tree-dump "24 c6::_ZTcv0_n16_v0_n12_NV2c62f2Ev" "class" { target ilp32 } } } -// { dg-final { scan-tree-dump "48 c6::_ZTcv0_n32_v0_n24_NV2c62f2Ev" "class" { target lp64 } } } +// { dg-final { scan-tree-dump "24 .*c6::_ZTcv0_n16_v0_n12_NV2c62f2Ev" "class" { target ilp32 } } } +// { dg-final { scan-tree-dump "48 .*c6::_ZTcv0_n32_v0_n24_NV2c62f2Ev" "class" { target lp64 } } } // once in c3-in-c6 - non-covariant, non-virtual base, calls f2 directly -// { dg-final { scan-tree-dump "28 c6::f2" "class" { target ilp32 } } } -// { dg-final { scan-tree-dump "56 c6::f2" "class" { target lp64 } } } +// { dg-final { scan-tree-dump "28 .*c6::f2" "class" { target ilp32 } } } +// { dg-final { scan-tree-dump "56 .*c6::f2" "class" { target lp64 } } } // once in c1-in-c3-in-c4-in-c6 - lost primary -// { dg-final { scan-tree-dump "80 0u" "class" { target ilp32 } } } -// { dg-final { scan-tree-dump "160 0u" "class" { target lp64 } } } +// { dg-final { scan-tree-dump "80 .*0u" "class" { target ilp32 } } } +// { dg-final { scan-tree-dump "160 .*0u" "class" { target lp64 } } } // once in c3-in-c4-in-c6 - c3 vcall offset -// { dg-final { scan-tree-dump "84 c6::_ZTv0_n16_NV2c62f2Ev" "class" { target ilp32 } } } -// { dg-final { scan-tree-dump "168 c6::_ZTv0_n32_NV2c62f2Ev" "class" { target lp64 } } } +// { dg-final { scan-tree-dump "84 .*c6::_ZTv0_n16_NV2c62f2Ev" "class" { target ilp32 } } } +// { dg-final { scan-tree-dump "168 .*c6::_ZTv0_n32_NV2c62f2Ev" "class" { target lp64 } } } // { dg-final { cleanup-tree-dump "class" } } |