On May 4, 2015 11:38:42 PM GMT+02:00, Eric Botcazou <ebotca...@adacore.com> wrote: >> 2015-05-01 Eric Botcazou <ebotca...@adacore.com> >> >> * expr.c (expand_expr_real_1) <SSA_NAME>: Try to substitute >constants >> on the RHS of expressions. >> * gimple-expr.h (is_gimple_constant): Reorder. > >Bummer. This breaks C++ debugging: > >+FAIL: gdb.cp/class2.exp: print alpha at marker return 0 >+FAIL: gdb.cp/class2.exp: print beta at marker return 0 >+FAIL: gdb.cp/class2.exp: print * aap at marker return 0 >+FAIL: gdb.cp/class2.exp: print * bbp at marker return 0 >+FAIL: gdb.cp/class2.exp: print * abp at marker return 0, s-p-o off >+FAIL: gdb.cp/class2.exp: print * (B *) abp at marker return 0 >+FAIL: gdb.cp/class2.exp: p acp >+FAIL: gdb.cp/class2.exp: p acp->c1 >+FAIL: gdb.cp/class2.exp: p acp->c2 > >because C++ is apparently relying on the assignment to the anonymous >return >object to preserve the debug info attached to a return statement. > >Would you be OK with a slight variation of your earlier idea, i.e. >calling >fold_stmt with a specific valueizer from fold_marked_statements instead >of the >implicit no_follow_ssa_edges in the inliner? Something like: > >tree >follow_anonymous_single_use_edges (tree val) >{ > if (TREE_CODE (val) == SSA_NAME > && (!SSA_NAME_VAR (val) || DECL_IGNORED_P (SSA_NAME_VAR (var))) > && has_single_use (val)) > return val > return NULL_TREE; >}
Yes, that works for me as well. Richard.