Patchwork introduce --param max-vartrack-expr-depth

login
register
mail settings
Submitter Alexandre Oliva
Date June 1, 2011, 10:25 p.m.
Message ID <ortyc9w5ng.fsf@livre.localdomain>
Download mbox | patch
Permalink /patch/98284/
State New
Headers show

Comments

Alexandre Oliva - June 1, 2011, 10:25 p.m.
On Jun  1, 2011, Alexandre Oliva <aoliva@redhat.com> wrote:

> On May 31, 2011, Alexandre Oliva <aoliva@redhat.com> wrote:
>> On May 30, 2011, Bernd Schmidt <bernds@codesourcery.com> wrote:
>>> On 05/30/2011 12:35 PM, Alexandre Oliva wrote:
>>>> One of my patches for PR 48866 regressed guality/asm-1.c on
>>>> x86_64-linux-gnu because what used to be a single complex debug value
>>>> expression became a chain of debug temps holding simpler expressions,
>>>> and this chain exceeded the default recursion depth in resolving
>>>> location expressions.

>>> What's the worst that can happen if you remove the limit altogether?

>> Exponential behavior comes to mind.

> It's unusual, but debug/pr41264-1.c exhibits it, given INT_MAX for the
> param, even though under such a (lack of) limit bootstrap doesn't go
> slower or faster, after restoring depth 5 for the reverse_op() use.  As
> Jakub pointed out, that one probably shouldn't be affected by the
> parameter, as depth 5 is exactly what we want for the kind of expression
> we're looking for.  With unlimited depth for that one, not even
> libiberty/md5.c compiles successfully, exhausting memory on a box with
> some 40GB of total VM (8+32).

> So I guess I'll stick with what I checked in, but keep a patch handy to
> bump the limit a little bit up and revert to 5 in reverse_op.

Such as this one...
Jakub Jelinek - June 2, 2011, 8:46 a.m.
On Wed, Jun 01, 2011 at 07:25:39PM -0300, Alexandre Oliva wrote:
> Such as this one...

I'd appreciate if this could go in...

> Index: gcc/params.def
> ===================================================================
> --- gcc/params.def.orig	2011-05-31 18:28:05.348070586 -0300
> +++ gcc/params.def	2011-06-01 17:09:41.117140944 -0300
> @@ -845,7 +845,7 @@ DEFPARAM (PARAM_MAX_VARTRACK_SIZE,
>  DEFPARAM (PARAM_MAX_VARTRACK_EXPR_DEPTH,
>  	  "max-vartrack-expr-depth",
>  	  "Max. recursion depth for expanding var tracking expressions",
> -	  10, 0, 0)
> +	  20, 0, 0)
>  
>  /* Set minimum insn uid for non-debug insns.  */
>  
> Index: gcc/var-tracking.c
> ===================================================================
> --- gcc/var-tracking.c.orig	2011-05-31 20:06:25.604477956 -0300
> +++ gcc/var-tracking.c	2011-05-31 23:56:06.578450957 -0300
> @@ -5288,7 +5288,7 @@ reverse_op (rtx val, const_rtx expr)
>        arg = XEXP (src, 1);
>        if (!CONST_INT_P (arg) && GET_CODE (arg) != SYMBOL_REF)
>  	{
> -	  arg = cselib_expand_value_rtx (arg, scratch_regs, EXPR_DEPTH);
> +	  arg = cselib_expand_value_rtx (arg, scratch_regs, 5);
>  	  if (arg == NULL_RTX)
>  	    return NULL_RTX;
>  	  if (!CONST_INT_P (arg) && GET_CODE (arg) != SYMBOL_REF)

	Jakub
Bernd Schmidt - June 2, 2011, 10:06 a.m.
On 06/02/2011 10:46 AM, Jakub Jelinek wrote:
> On Wed, Jun 01, 2011 at 07:25:39PM -0300, Alexandre Oliva wrote:
>> Such as this one...
> 
> I'd appreciate if this could go in...

Go on then.

Bernd

Patch

Index: gcc/params.def
===================================================================
--- gcc/params.def.orig	2011-05-31 18:28:05.348070586 -0300
+++ gcc/params.def	2011-06-01 17:09:41.117140944 -0300
@@ -845,7 +845,7 @@  DEFPARAM (PARAM_MAX_VARTRACK_SIZE,
 DEFPARAM (PARAM_MAX_VARTRACK_EXPR_DEPTH,
 	  "max-vartrack-expr-depth",
 	  "Max. recursion depth for expanding var tracking expressions",
-	  10, 0, 0)
+	  20, 0, 0)
 
 /* Set minimum insn uid for non-debug insns.  */
 
Index: gcc/var-tracking.c
===================================================================
--- gcc/var-tracking.c.orig	2011-05-31 20:06:25.604477956 -0300
+++ gcc/var-tracking.c	2011-05-31 23:56:06.578450957 -0300
@@ -5288,7 +5288,7 @@  reverse_op (rtx val, const_rtx expr)
       arg = XEXP (src, 1);
       if (!CONST_INT_P (arg) && GET_CODE (arg) != SYMBOL_REF)
 	{
-	  arg = cselib_expand_value_rtx (arg, scratch_regs, EXPR_DEPTH);
+	  arg = cselib_expand_value_rtx (arg, scratch_regs, 5);
 	  if (arg == NULL_RTX)
 	    return NULL_RTX;
 	  if (!CONST_INT_P (arg) && GET_CODE (arg) != SYMBOL_REF)