Patchwork [pph] Save/restore PARM_DECL DECL_ARG_TYPE (issue4441079)

login
register
mail settings
Submitter Lawrence Crowl
Date April 29, 2011, 1:10 a.m.
Message ID <20110429011048.890D222264E@jade.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/93367/
State New
Headers show

Comments

Lawrence Crowl - April 29, 2011, 1:10 a.m.
This patch saves and restores the PARM_DECL DECL_ARG_TYPE in the PPH file.


--
This patch is available for review at http://codereview.appspot.com/4441079
Richard Guenther - April 29, 2011, 8:29 a.m.
On Fri, Apr 29, 2011 at 3:10 AM, Lawrence Crowl <crowl@google.com> wrote:
> This patch saves and restores the PARM_DECL DECL_ARG_TYPE in the PPH file.

Should be already streamed via lto_output_ts_decl_common_tree_pointers
as it is aliased to DECL_INITIAL.

Richard.

> Index: gcc/cp/ChangeLog.pph
>
> 2011-04-28  Lawrence Crowl <crowl@google.com>
>
>        * pph-streamer-out.c (pph_stream_write_tree): Write PARM_DECL
>        DECL_ARG_TYPE.
>        * pph-streamer-in.c (pph_stream_read_tree): Read PARM_DECL
>        DECL_ARG_TYPE.
>
>
> Index: gcc/cp/pph-streamer-in.c
> ===================================================================
> --- gcc/cp/pph-streamer-in.c    (revision 173124)
> +++ gcc/cp/pph-streamer-in.c    (working copy)
> @@ -791,6 +791,8 @@ pph_stream_read_tree (struct lto_input_b
>          pph_stream_read_lang_specific (stream, expr);
>          if (TREE_CODE (expr) == FUNCTION_DECL)
>            DECL_SAVED_TREE (expr) = pph_input_tree (stream);
> +         else if (TREE_CODE (expr) == PARM_DECL)
> +           DECL_ARG_TYPE (expr) = pph_input_tree (stream);
>        }
>
>       if (TREE_CODE (expr) == TYPE_DECL)
> Index: gcc/cp/pph-streamer-out.c
> ===================================================================
> --- gcc/cp/pph-streamer-out.c   (revision 173124)
> +++ gcc/cp/pph-streamer-out.c   (working copy)
> @@ -796,6 +796,8 @@ pph_stream_write_tree (struct output_blo
>
>          if (TREE_CODE (expr) == FUNCTION_DECL)
>            pph_output_tree_or_ref_1 (stream, DECL_SAVED_TREE (expr), ref_p, 3);
> +         else if (TREE_CODE (expr) == PARM_DECL)
> +           pph_output_tree_or_ref_1 (stream, DECL_ARG_TYPE (expr), ref_p, 3);
>        }
>
>       if (TREE_CODE (expr) == TYPE_DECL)
>
> --
> This patch is available for review at http://codereview.appspot.com/4441079
>
Diego Novillo - April 29, 2011, 1:01 p.m.
On Fri, Apr 29, 2011 at 04:29, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Fri, Apr 29, 2011 at 3:10 AM, Lawrence Crowl <crowl@google.com> wrote:
>> This patch saves and restores the PARM_DECL DECL_ARG_TYPE in the PPH file.
>
> Should be already streamed via lto_output_ts_decl_common_tree_pointers
> as it is aliased to DECL_INITIAL.

No, I moved the streaming of DECL_INITIAL to a streamer hook because
in the gimple case we do more than streaming the initial value.  We
get the varpool node for the symbol and only stream the initial value
if we can find it.

Lawrence, I think we should just simply stream DECL_INITIAL in the
DECL_P case.  We are missing initializer expressions in every
variable, otherwise.


Diego.
Lawrence Crowl - April 29, 2011, 9:34 p.m.
On 4/29/11, Diego Novillo <dnovillo@google.com> wrote:
> On Apr 29, 2011 Richard Guenther <richard.guenther@gmail.com> wrote:
> > On Apr 29, 2011 Lawrence Crowl <crowl@google.com> wrote:
> > > This patch saves and restores the PARM_DECL DECL_ARG_TYPE in the
> > > PPH file.
> >
> > Should be already streamed via lto_output_ts_decl_common_tree_pointers
> > as it is aliased to DECL_INITIAL.
>
> No, I moved the streaming of DECL_INITIAL to a streamer hook because
> in the gimple case we do more than streaming the initial value.  We
> get the varpool node for the symbol and only stream the initial value
> if we can find it.
>
> Lawrence, I think we should just simply stream DECL_INITIAL in the
> DECL_P case.  We are missing initializer expressions in every
> variable, otherwise.

Done.  It seems to have fixed one more unexpected failure.

Patch

Index: gcc/cp/ChangeLog.pph

2011-04-28  Lawrence Crowl <crowl@google.com>

        * pph-streamer-out.c (pph_stream_write_tree): Write PARM_DECL
        DECL_ARG_TYPE.
        * pph-streamer-in.c (pph_stream_read_tree): Read PARM_DECL
        DECL_ARG_TYPE.


Index: gcc/cp/pph-streamer-in.c
===================================================================
--- gcc/cp/pph-streamer-in.c	(revision 173124)
+++ gcc/cp/pph-streamer-in.c	(working copy)
@@ -791,6 +791,8 @@  pph_stream_read_tree (struct lto_input_b
 	  pph_stream_read_lang_specific (stream, expr);
 	  if (TREE_CODE (expr) == FUNCTION_DECL)
 	    DECL_SAVED_TREE (expr) = pph_input_tree (stream);
+	  else if (TREE_CODE (expr) == PARM_DECL)
+	    DECL_ARG_TYPE (expr) = pph_input_tree (stream);
 	}
 
       if (TREE_CODE (expr) == TYPE_DECL)
Index: gcc/cp/pph-streamer-out.c
===================================================================
--- gcc/cp/pph-streamer-out.c	(revision 173124)
+++ gcc/cp/pph-streamer-out.c	(working copy)
@@ -796,6 +796,8 @@  pph_stream_write_tree (struct output_blo
 
 	  if (TREE_CODE (expr) == FUNCTION_DECL)
 	    pph_output_tree_or_ref_1 (stream, DECL_SAVED_TREE (expr), ref_p, 3);
+	  else if (TREE_CODE (expr) == PARM_DECL)
+	    pph_output_tree_or_ref_1 (stream, DECL_ARG_TYPE (expr), ref_p, 3);
 	}
 
       if (TREE_CODE (expr) == TYPE_DECL)