This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [vta] more propagation of information in debug annotations


On Jan  9, 2008, Eric Botcazou <ebotcazou@adacore.com> wrote:

> @@ -1776,6 +1776,12 @@ expand_debug_expr (tree exp)
>         tree tem = get_inner_reference (exp, &bitsize, &bitpos, &offset,
>                                         &mode1, &unsignedp, &volatilep, true);
 
> +       if (tem == exp)
> +         {
> +           gcc_assert (TREE_CODE (exp) == VIEW_CONVERT_EXPR);
> +           tem = TREE_OPERAND (exp, 0);
> +         }
> +
>         op0 = expand_debug_expr (tem);


> You probably just need to pass false as last argument to get_inner_reference.

Indeed, that ought to work, thanks!

I'm going to give this a round of testing and then, if it passes
(which it most likely will), I'll install it in the vta branch.

for  gcc/ChangeLog.vta
from  Alexandre Oliva  <aoliva@redhat.com>

	* cfgexpand.c (expand_debug_expr): Avoid VIEW_CONVERT_EXPR
	infinite recursion more trivially.  Suggested by Eric Botcazou.

Index: gcc/cfgexpand.c
===================================================================
--- gcc/cfgexpand.c.orig	2008-01-07 18:18:49.000000000 -0200
+++ gcc/cfgexpand.c	2008-01-09 07:38:53.000000000 -0200
@@ -1801,13 +1801,7 @@ expand_debug_expr (tree exp)
 	tree offset;
 	int volatilep = 0;
 	tree tem = get_inner_reference (exp, &bitsize, &bitpos, &offset,
-					&mode1, &unsignedp, &volatilep, true);
-
-	if (tem == exp)
-	  {
-	    gcc_assert (TREE_CODE (exp) == VIEW_CONVERT_EXPR);
-	    tem = TREE_OPERAND (exp, 0);
-	  }
+					&mode1, &unsignedp, &volatilep, false);
 
 	op0 = expand_debug_expr (tem);
 
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]