[PATCH] Perform some kind of special TER for asm input operands that don't allow regs nor memory (PR inline-asm/23200)

Richard Henderson rth@redhat.com
Thu Feb 3 19:23:00 GMT 2011


On 02/03/2011 10:21 AM, Jakub Jelinek wrote:
> Hi!
> 
> The attached testcase fails to assemble at -O0, because at -O0
> we don't perform TER (and anyway, TER for -O0 wants to ensure the
> locus stays the same, while in the testcase there are different columns
> involved).  The following patch, instead of enabling TER at -O0,
> instead just only looks at STMTs defining replaceable SSA_NAMEs
> when expanding with EXPAND_INITIALIZER (which is where we usually want
> something constant, among most important places asm input operands
> that allow neither regs nor mems).
> 
> Perhaps we want to limit it some more, e.g. don't look at SSA_NAME_DEF_STMT
> if it sets a SSA_NAME for user variable at -O0, and perhaps expr.c
> should perform this only if (!optimize || !flag_tree_ter).
> If we'd avoid user variables (!DECL_IGNORED_P or something similar), then
> pr27528.c testcase wouldn't need to be adjusted.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux.
> 
> 2011-02-03  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR inline-asm/23200
> 	* tree-ssa-ter.c (is_replaceable_p): Add TER argument.  Don't
> 	do bb, locus and block comparison and disallow loads if it is
> 	not set.
> 	(stmt_is_replaceable_p): New function.
> 	(process_replaceable, find_replaceable_in_bb): Adjust is_replaceable_p
> 	callers.
> 	* expr.c (expand_expr_real_1) <case SSA_NAME>: If
> 	get_gimple_for_ssa_name try for EXPAND_INITIALIZER harder to use
> 	SSA_NAME_DEF_STMT.

The expand_expr change seems fine.

The is_replaceable_p change lacks documentation for the TER argument,
and reading the patch I wasn't sure precisely what it is supposed to mean.


r~



More information about the Gcc-patches mailing list