[tree-ssa] fix opt/13798
Richard Henderson
rth@redhat.com
Wed Jan 28 22:16:00 GMT 2004
On Wed, Jan 28, 2004 at 07:48:24PM +0000, Joern Rennecke wrote:
> +/* Iff EXPRX is a non-addressed variable in function scope, or a component
> + of one, return that variable. */
> +static tree
> +non_addressed_function_scope_var (exprx)
> + tree exprx;
> +{
> + if (exprx)
> + {
> + while (TREE_CODE (exprx) == COMPONENT_REF)
> + {
> + exprx = TREE_OPERAND (exprx, 0);
> + /* component_ref_for_mem_expr will just put NULL_RTX into argument
> + 0 of a COMPONENT_REF if it doesn't have a declaration. */
> + if (! exprx)
> + return 0;
> + }
> + if (TREE_CODE (exprx) == VAR_DECL
> + && TREE_STATIC (exprx)
> + && ! TREE_ADDRESSABLE (exprx)
> + && decl_function_context (exprx) != 0)
> + return exprx;
> + }
> + return 0;
> +}
> +
> /* Return nonzero if we can deterimine the exprs corresponding to memrefs
> X and Y and they do not overlap. */
>
> static int
> nonoverlapping_memrefs_p (x, y)
> @@ -1945,10 +1971,21 @@ nonoverlapping_memrefs_p (x, y)
> tree exprx = MEM_EXPR (x), expry = MEM_EXPR (y);
> rtx rtlx, rtly;
> rtx basex, basey;
> rtx moffsetx, moffsety;
> HOST_WIDE_INT offsetx = 0, offsety = 0, sizex, sizey, tem;
> +
> + if (exprx != expry
> + && (non_addressed_function_scope_var (exprx) !=
> + non_addressed_function_scope_var (expry))
> + /* (mem:BLK (const_int 0 [0x0]) [0 A8]) is used as a wildcard,
> + when scan_loop detects that there is a non-pure function call -
> + which might cause recursion. */
> + && XEXP (x, 0) != const0_rtx
> + && XEXP (y, 0) != const0_rtx)
> +
> + return 1;
What are you supposed to be proving here? What's special about
function-scope?
r~
More information about the Gcc-patches
mailing list