https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120629

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |lto

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
  static const int max_clauses = 8;
  clause_t m_clause[max_clauses + 1];


```
void
ipa_predicate::stream_in (class lto_input_block *ib)
{
  clause_t clause;
  int k = 0;

  do
    {
      gcc_assert (k <= max_clauses);
      clause = m_clause[k++] = streamer_read_uhwi (ib);
    }
  while (clause);

  /* Zero-initialize the remaining clauses in OUT.  */
  while (k <= max_clauses)
    m_clause[k++] = 0;
}


/* Write predicate P to OB.  */

void
ipa_predicate::stream_out (struct output_block *ob)
{
  int j;
  for (j = 0; m_clause[j]; j++)
    {
      gcc_assert (j < max_clauses);
      streamer_write_uhwi (ob, m_clause[j]);
    }
  streamer_write_uhwi (ob, 0);
}


```

```
      count2 = streamer_read_uhwi (&ib);
      gcc_assert (!info || !info->size_time_table.length ());
      if (info && count2)
        info->size_time_table.reserve_exact (count2);
      for (j = 0; j < count2; j++)
        {
          class size_time_entry e;

          e.size = streamer_read_uhwi (&ib);
          e.time = sreal::stream_in (&ib);
          e.exec_predicate.stream_in (&ib); <---
          e.nonconst_predicate.stream_in (&ib);

          if (info)
            info->size_time_table.quick_push (e);
        }
```

```
          streamer_write_uhwi (ob, info->size_time_table.length ());
          for (i = 0; info->size_time_table.iterate (i, &e); i++)
            {
              streamer_write_uhwi (ob, e->size);
              e->time.stream_out (ob);
              e->exec_predicate.stream_out (ob);
              e->nonconst_predicate.stream_out (ob);
            }
```

Which stage is this?

The code looks correct and writing and reading.

Reply via email to