Commit eafedef3 by Jan Hubicka Committed by Jan Hubicka

re PR tree-optimization/45605 (Missed devirtualization)


	PR tree-optimization/45605
	* cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in ADDR_EXPR

From-SVN: r164148
parent 292beb8f
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> 2010-09-08 Jakub Jelinek <jakub@redhat.com>
PR c++/45588 PR c++/45588
......
...@@ -7797,7 +7797,7 @@ build_vtbl_initializer (tree binfo, ...@@ -7797,7 +7797,7 @@ build_vtbl_initializer (tree binfo,
{ {
fn = abort_fndecl; fn = abort_fndecl;
if (abort_fndecl_addr == NULL) 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; init = abort_fndecl_addr;
} }
else else
...@@ -7810,7 +7810,7 @@ build_vtbl_initializer (tree binfo, ...@@ -7810,7 +7810,7 @@ build_vtbl_initializer (tree binfo,
} }
/* Take the address of the function, considering it to be of an /* Take the address of the function, considering it to be of an
appropriate generic type. */ appropriate generic type. */
init = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn); init = fold_convert (vfunc_ptr_type_node, build_fold_addr_expr (fn));
} }
} }
......
2010-09-10 Jan Hubicka <jh@suse.cz>
* g++.dg/inherit/covariant7.C: Fix pattern matching.
2010-09-10 Martin Jambor <mjambor@suse.cz> 2010-09-10 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/44972 PR tree-optimization/44972
......
...@@ -36,16 +36,16 @@ struct c6 : c0, c3, c4 ...@@ -36,16 +36,16 @@ struct c6 : c0, c3, c4
// f2 appears four times in the c6 vtables: // 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 // 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 "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 "48 .*c6::_ZTcv0_n32_v0_n24_NV2c62f2Ev" "class" { target lp64 } } }
// once in c3-in-c6 - non-covariant, non-virtual base, calls f2 directly // 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 "28 .*c6::f2" "class" { target ilp32 } } }
// { dg-final { scan-tree-dump "56 c6::f2" "class" { target lp64 } } } // { dg-final { scan-tree-dump "56 .*c6::f2" "class" { target lp64 } } }
// once in c1-in-c3-in-c4-in-c6 - lost primary // 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 "80 .*0u" "class" { target ilp32 } } }
// { dg-final { scan-tree-dump "160 0u" "class" { target lp64 } } } // { dg-final { scan-tree-dump "160 .*0u" "class" { target lp64 } } }
// once in c3-in-c4-in-c6 - c3 vcall offset // 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 "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 "168 .*c6::_ZTv0_n32_NV2c62f2Ev" "class" { target lp64 } } }
// { dg-final { cleanup-tree-dump "class" } } // { dg-final { cleanup-tree-dump "class" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment