> > * ipa-inline-analysis.c (add_condition): Add conditions parameter; > > simplify obviously true clauses. > > (and_predicates, or_predicates): Add conditions parameter. > > (inline_duplication_hoook): Update. > > (mark_modified): New function. > > (unmodified_parm): New function. > > (eliminated_by_inlining_prob, (set_cond_stmt_execution_predicate, > > set_switch_stmt_execution_predicate, will_be_nonconstant_predicate): > > Use unmodified_parm. > > (estimate_function_body_sizes): Update. > > (remap_predicate): Update. > > This breaks things in Ada: > > Program received signal SIGSEGV, Segmentation fault. > walk_aliased_vdefs_1 (ref=0xffffcbf4, vdef=0x0, > walker=0x873e3e0 <mark_modified>, data=0xffffcc1f, visited=0xffffcbc0, > cnt=0) at /home/eric/svn/gcc/gcc/tree-ssa-alias.c:1996 > 1996 gimple def_stmt = SSA_NAME_DEF_STMT (vdef); > (gdb) bt > #0 walk_aliased_vdefs_1 (ref=0xffffcbf4, vdef=0x0, > walker=0x873e3e0 <mark_modified>, data=0xffffcc1f, visited=0xffffcbc0, > cnt=0) at /home/eric/svn/gcc/gcc/tree-ssa-alias.c:1996 > #1 0x089c3a6d in walk_aliased_vdefs (ref=0xffffcbf4, vdef=0x0, > walker=0x873e3e0 <mark_modified>, data=0xffffcc1f, visited=0xffffcbc0) > at /home/eric/svn/gcc/gcc/tree-ssa-alias.c:2037 > #2 0x087456b5 in unmodified_parm (stmt=0xf7cf6ab0, op=0xf7cf77e0) > at /home/eric/svn/gcc/gcc/ipa-inline-analysis.c:1104 > #3 0x08748a99 in eliminated_by_inlining_prob (stmt=<optimized out>) > at /home/eric/svn/gcc/gcc/ipa-inline-analysis.c:1165
Hi, the problem here is that we consider ¶m.foo to be a memory reference, while it is not. The following patch should fix it, but because it changes the behaviour of inline heuristics, I will run bechmarks tonight before committing it. Index: ipa-inline-analysis.c =================================================================== --- ipa-inline-analysis.c (revision 179003) +++ ipa-inline-analysis.c (working copy) @@ -1149,18 +1149,15 @@ eliminated_by_inlining_prob (gimple stmt { tree rhs = gimple_assign_rhs1 (stmt); tree lhs = gimple_assign_lhs (stmt); - tree inner_rhs = rhs; - tree inner_lhs = lhs; + tree inner_rhs = get_base_address (rhs); + tree inner_lhs = get_base_address (lhs); bool rhs_free = false; bool lhs_free = false; - while (handled_component_p (inner_lhs) - || TREE_CODE (inner_lhs) == MEM_REF) - inner_lhs = TREE_OPERAND (inner_lhs, 0); - while (handled_component_p (inner_rhs) - || TREE_CODE (inner_rhs) == ADDR_EXPR - || TREE_CODE (inner_rhs) == MEM_REF) - inner_rhs = TREE_OPERAND (inner_rhs, 0); + if (!inner_rhs) + inner_rhs = rhs; + if (!inner_lhs) + inner_lhs = lhs; if (unmodified_parm (stmt, inner_rhs)) rhs_free = true;