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: [PATCH][LTO] Do not pretend we have value exprs


On Wed, 2 Dec 2009, Diego Novillo wrote:

> On Wed, Dec 2, 2009 at 13:13, Richard Guenther <rguenther@suse.de> wrote:
> 
> > 2009-12-02 ÂRichard Guenther Â<rguenther@suse.de>
> >
> > Â Â Â Â* lto-streamer-out.c (pack_ts_decl_common_value_fields):
> > Â Â Â ÂDo not pretend we have value exprs.
> 
> OK.

Actually this change was bogus.  RTL expansion requires the bit
set to avoid stack expanding VLAs.  So to make debug happy we
have to stream the value expr whenever we have to pretend it is
there.

Bootstrapped and tested on x86_64-unknown-linux-gnu, I'm currently
building SPEC with it.  Ok if that passes?

Thanks,
Richard.

2009-12-03  Richard Guenther  <rguenther@suse.de>

	* lto-streamer-out.c (pack_ts_decl_common_value_fields):
	Revert previous change.
	(lto_output_ts_decl_common_tree_pointers): Stream DECL_VALUE_EXPR.
	* lto-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
	Likewise.

Index: gcc/lto-streamer-out.c
===================================================================
*** gcc/lto-streamer-out.c	(revision 154941)
--- gcc/lto-streamer-out.c	(working copy)
*************** pack_ts_decl_common_value_fields (struct
*** 430,440 ****
        || TREE_CODE (expr) == VAR_DECL)
      {
        bp_pack_value (bp, DECL_BY_REFERENCE (expr), 1);
-       /* DECL_HAS_VALUE_EXPR_P: Do not falsely pretend we have value
-          expressions, we do not stream those at the moment.  */
        if (TREE_CODE (expr) == VAR_DECL
  	  || TREE_CODE (expr) == PARM_DECL)
! 	bp_pack_value (bp, false, 1);
        bp_pack_value (bp, DECL_RESTRICTED_P (expr), 1);
      }
  }
--- 430,438 ----
        || TREE_CODE (expr) == VAR_DECL)
      {
        bp_pack_value (bp, DECL_BY_REFERENCE (expr), 1);
        if (TREE_CODE (expr) == VAR_DECL
  	  || TREE_CODE (expr) == PARM_DECL)
! 	bp_pack_value (bp, DECL_HAS_VALUE_EXPR_P (expr), 1);
        bp_pack_value (bp, DECL_RESTRICTED_P (expr), 1);
      }
  }
*************** lto_output_ts_decl_common_tree_pointers 
*** 850,855 ****
--- 848,858 ----
  
    if (TREE_CODE (expr) == PARM_DECL)
      lto_output_chain (ob, TREE_CHAIN (expr), ref_p);
+ 
+   if ((TREE_CODE (expr) == VAR_DECL
+        || TREE_CODE (expr) == PARM_DECL)
+       && DECL_HAS_VALUE_EXPR_P (expr))
+     lto_output_tree_or_ref (ob, DECL_VALUE_EXPR (expr), ref_p);
  }
  
  
Index: gcc/lto-streamer-in.c
===================================================================
*** gcc/lto-streamer-in.c	(revision 154941)
--- gcc/lto-streamer-in.c	(working copy)
*************** lto_input_ts_decl_common_tree_pointers (
*** 2044,2049 ****
--- 2044,2054 ----
  
    if (TREE_CODE (expr) == PARM_DECL)
      TREE_CHAIN (expr) = lto_input_chain (ib, data_in);
+ 
+   if ((TREE_CODE (expr) == VAR_DECL
+        || TREE_CODE (expr) == PARM_DECL)
+       && DECL_HAS_VALUE_EXPR_P (expr))
+     SET_DECL_VALUE_EXPR (expr, lto_input_tree (ib, data_in));
  }
  
  

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