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]

[PATCH][LTO] Change DECL_ARGUMENTS streaming


This changes how we stream DECL_ARGUMENTS because the way we do it
now (recursing over TREE_CHAIN of the PARM_DECLs) puts quite a burden
on stack use for limits-fndefn.c.  The following changes streaming
that chain to how we stream all other chains (apart from TREE_LISTs
which we arguably should change as well).

LTO bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2012-10-17  Richard Biener  <rguenther@suse.de>

	* tree-streamer-out.c (write_ts_decl_common_tree_pointers):
	Do not write TREE_CHAIN of PARM_DECLs.
	(write_ts_decl_non_common_tree_pointers): Instead stream
	the DECL_ARGUMENTS chain.
	* tree-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
	Do not read TREE_CHAIN of PARM_DECLs.
	(lto_input_ts_decl_non_common_tree_pointes): Instead read
	the DECL_ARGUMENTS as chain.

Index: gcc/tree-streamer-out.c
===================================================================
*** gcc/tree-streamer-out.c	(revision 192499)
--- gcc/tree-streamer-out.c	(working copy)
*************** write_ts_decl_common_tree_pointers (stru
*** 562,570 ****
       for early inlining so drop it on the floor instead of ICEing in
       dwarf2out.c.  */
  
-   if (TREE_CODE (expr) == PARM_DECL)
-     streamer_write_chain (ob, TREE_CHAIN (expr), ref_p);
- 
    if ((TREE_CODE (expr) == VAR_DECL
         || TREE_CODE (expr) == PARM_DECL)
        && DECL_HAS_VALUE_EXPR_P (expr))
--- 562,567 ----
*************** write_ts_decl_non_common_tree_pointers (
*** 585,591 ****
  {
    if (TREE_CODE (expr) == FUNCTION_DECL)
      {
!       stream_write_tree (ob, DECL_ARGUMENTS (expr), ref_p);
        stream_write_tree (ob, DECL_RESULT (expr), ref_p);
      }
    else if (TREE_CODE (expr) == TYPE_DECL)
--- 582,588 ----
  {
    if (TREE_CODE (expr) == FUNCTION_DECL)
      {
!       streamer_write_chain (ob, DECL_ARGUMENTS (expr), ref_p);
        stream_write_tree (ob, DECL_RESULT (expr), ref_p);
      }
    else if (TREE_CODE (expr) == TYPE_DECL)
Index: gcc/tree-streamer-in.c
===================================================================
*** gcc/tree-streamer-in.c	(revision 192499)
--- gcc/tree-streamer-in.c	(working copy)
*************** lto_input_ts_decl_common_tree_pointers (
*** 643,651 ****
       for early inlining so drop it on the floor instead of ICEing in
       dwarf2out.c.  */
  
-   if (TREE_CODE (expr) == PARM_DECL)
-     TREE_CHAIN (expr) = streamer_read_chain (ib, data_in);
- 
    if ((TREE_CODE (expr) == VAR_DECL
         || TREE_CODE (expr) == PARM_DECL)
        && DECL_HAS_VALUE_EXPR_P (expr))
--- 643,648 ----
*************** lto_input_ts_decl_non_common_tree_pointe
*** 670,676 ****
  {
    if (TREE_CODE (expr) == FUNCTION_DECL)
      {
!       DECL_ARGUMENTS (expr) = stream_read_tree (ib, data_in);
        DECL_RESULT (expr) = stream_read_tree (ib, data_in);
      }
    else if (TREE_CODE (expr) == TYPE_DECL)
--- 667,673 ----
  {
    if (TREE_CODE (expr) == FUNCTION_DECL)
      {
!       DECL_ARGUMENTS (expr) = streamer_read_chain (ib, data_in);
        DECL_RESULT (expr) = stream_read_tree (ib, data_in);
      }
    else if (TREE_CODE (expr) == TYPE_DECL)


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