Patchwork Fix PR54837

login
register
mail settings
Submitter Richard Guenther
Date Oct. 9, 2012, 2:35 p.m.
Message ID <alpine.LNX.2.00.1210091634470.4063@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/190334/
State New
Headers show

Comments

Richard Guenther - Oct. 9, 2012, 2:35 p.m.
On Tue, 9 Oct 2012, Richard Biener wrote:

> 
> This should fix PR54837, LTO is not yet prepared for
> debug source stmts.  The following moves checking code that
> triggers to a place where it hopefully does not trigger.
> 
> LTO bootstrap is broken in other ways though :(
> 
> Will commit after non-LTO bootstrap finished to make progress.

As Jakub says the checking doesn't add much so I am installing
the following instead, as obvious.

Richard.

2012-10-09  Richard Guenther  <rguenther@suse.de>

	PR middle-end/54837
	* cfgexpand.c (expand_debug_source_expr): Move checking
	code conditional on a found decl_debug_args vector.
Jakub Jelinek - Oct. 9, 2012, 2:39 p.m.
On Tue, Oct 09, 2012 at 04:35:16PM +0200, Richard Biener wrote:
> As Jakub says the checking doesn't add much so I am installing
> the following instead, as obvious.
> 
> Richard.
> 
> 2012-10-09  Richard Guenther  <rguenther@suse.de>
> 
> 	PR middle-end/54837
> 	* cfgexpand.c (expand_debug_source_expr): Move checking
> 	code conditional on a found decl_debug_args vector.

Thanks.

	Jakub

Patch

Index: gcc/cfgexpand.c
===================================================================
--- gcc/cfgexpand.c	(revision 192253)
+++ gcc/cfgexpand.c	(working copy)
@@ -3521,22 +3521,13 @@  expand_debug_source_expr (tree exp)
 	    && !DECL_INCOMING_RTL (exp)
 	    && DECL_ABSTRACT_ORIGIN (current_function_decl))
 	  {
-	    tree aexp = exp;
-	    if (DECL_ABSTRACT_ORIGIN (exp))
-	      aexp = DECL_ABSTRACT_ORIGIN (exp);
+	    tree aexp = DECL_ORIGIN (exp);
 	    if (DECL_CONTEXT (aexp)
 		== DECL_ABSTRACT_ORIGIN (current_function_decl))
 	      {
 		VEC(tree, gc) **debug_args;
 		unsigned int ix;
 		tree ddecl;
-#ifdef ENABLE_CHECKING
-		tree parm;
-		for (parm = DECL_ARGUMENTS (current_function_decl);
-		     parm; parm = DECL_CHAIN (parm))
-		  gcc_assert (parm != exp
-			      && DECL_ABSTRACT_ORIGIN (parm) != aexp);
-#endif
 		debug_args = decl_debug_args_lookup (current_function_decl);
 		if (debug_args != NULL)
 		  {