diff mbox

[PR,57289] Fix streaming order in ipa_read_node_info

Message ID 20130521112432.GC23266@virgil.suse
State New
Headers show

Commit Message

Martin Jambor May 21, 2013, 11:24 a.m. UTC
Hi,

PR 57289 is an LTO streaming issue.  We should process the bitpack
before moving on to read other stuff in ipa_read_node_info because
bp_unpack_value might read from the stream if there are many bits to
read.  Fixed by the following patch which makes 454.calculix build
with -flto again and also passes bootstrap and testing on
x86_64-linux. OK for trunk?

Thanks,

Martin


2013-05-20  Martin Jambor  <mjambor@suse.cz>

	PR lto/57289
	* ipa-prop.c (ipa_read_node_info): Process param_used and
	controlled_uses in the same order as when writing.

Comments

Richard Biener May 21, 2013, 12:26 p.m. UTC | #1
On Tue, May 21, 2013 at 1:24 PM, Martin Jambor <mjambor@suse.cz> wrote:
> Hi,
>
> PR 57289 is an LTO streaming issue.  We should process the bitpack
> before moving on to read other stuff in ipa_read_node_info because
> bp_unpack_value might read from the stream if there are many bits to
> read.  Fixed by the following patch which makes 454.calculix build
> with -flto again and also passes bootstrap and testing on
> x86_64-linux. OK for trunk?

Ok.

Thanks,
Richard.

> Thanks,
>
> Martin
>
>
> 2013-05-20  Martin Jambor  <mjambor@suse.cz>
>
>         PR lto/57289
>         * ipa-prop.c (ipa_read_node_info): Process param_used and
>         controlled_uses in the same order as when writing.
>
> Index: src/gcc/ipa-prop.c
> ===================================================================
> --- src.orig/gcc/ipa-prop.c
> +++ src/gcc/ipa-prop.c
> @@ -3849,9 +3849,9 @@ ipa_read_node_info (struct lto_input_blo
>      info->uses_analysis_done = true;
>    info->node_enqueued = false;
>    for (k = 0; k < ipa_get_param_count (info); k++)
> -    ipa_set_controlled_uses (info, k, streamer_read_hwi (ib));
> -  for (k = 0; k < ipa_get_param_count (info); k++)
>      ipa_set_param_used (info, k, bp_unpack_value (&bp, 1));
> +  for (k = 0; k < ipa_get_param_count (info); k++)
> +    ipa_set_controlled_uses (info, k, streamer_read_hwi (ib));
>    for (e = node->callees; e; e = e->next_callee)
>      {
>        struct ipa_edge_args *args = IPA_EDGE_REF (e);
diff mbox

Patch

Index: src/gcc/ipa-prop.c
===================================================================
--- src.orig/gcc/ipa-prop.c
+++ src/gcc/ipa-prop.c
@@ -3849,9 +3849,9 @@  ipa_read_node_info (struct lto_input_blo
     info->uses_analysis_done = true;
   info->node_enqueued = false;
   for (k = 0; k < ipa_get_param_count (info); k++)
-    ipa_set_controlled_uses (info, k, streamer_read_hwi (ib));
-  for (k = 0; k < ipa_get_param_count (info); k++)
     ipa_set_param_used (info, k, bp_unpack_value (&bp, 1));
+  for (k = 0; k < ipa_get_param_count (info); k++)
+    ipa_set_controlled_uses (info, k, streamer_read_hwi (ib));
   for (e = node->callees; e; e = e->next_callee)
     {
       struct ipa_edge_args *args = IPA_EDGE_REF (e);