This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Perform anonymous constant propagation during inlining
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 05 May 2015 07:43:45 +0200
- Subject: Re: [patch] Perform anonymous constant propagation during inlining
- Authentication-results: sourceware.org; auth=none
- References: <6476732 dot lMFodJZTVz at polaris> <3882455 dot jixBbSixVe at polaris> <1538996 dot TcTA0zy8bB at polaris> <6508064 dot T36Z3tQFqI at polaris>
On May 4, 2015 11:38:42 PM GMT+02:00, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> 2015-05-01 Eric Botcazou <ebotcazou@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.