<html>#2426: g++-10 possibly miscompiles parts of Carpet
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Roland Haas</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>major</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Other</td></tr>
</table>

<p>Comment (by Erik Schnetter):</p>
<p>Yes, this code looks fishy. I looked for static variables, but I didn’t see this mutable one. Creating the iterator is expensive, hence this memoized variables.</p>
<p>The best way to rewrite this would be to add an explicit conversion (calling <code>serialise</code>) to a new type that has a cheap iterator (<code>iter_memo_t</code>). That requires rewriting all callers to <code>begin</code> and <code>end</code>, but that shouldn’t be too bad because it only makes expensive operations explicit.</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2426/g-10-possibly-miscompiles-parts-of-carpet'>https://bitbucket.org/einsteintoolkit/tickets/issues/2426/g-10-possibly-miscompiles-parts-of-carpet</a></p>
</html>