<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Conundrum</title>
	<atom:link href="http://tromey.com/blog/?feed=rss2&#038;p=277" rel="self" type="application/rss+xml" />
	<link>http://tromey.com/blog/?p=277&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=conundrum</link>
	<description></description>
	<lastBuildDate>Wed, 15 May 2013 18:03:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: tom</title>
		<link>http://tromey.com/blog/?p=277&#038;cpage=1#comment-49317</link>
		<dc:creator>tom</dc:creator>
		<pubDate>Fri, 06 Jul 2007 16:36:56 +0000</pubDate>
		<guid isPermaLink="false">http://tromey.com/blog/?p=277#comment-49317</guid>
		<description><![CDATA[That plan won&#039;t work either.  In the full incremental case, there would never be a nice way to unsmash a decl -- but we definitely need this.

Instead I&#039;m going to have a per-thread hash table mapping unmodified decls to their smashed variants.  Then I&#039;ll audit the C front end to add hash lookups everywhere they are needed.  Not fun but it will give the correct answer in all the scenarios.]]></description>
		<content:encoded><![CDATA[<p>That plan won&#8217;t work either.  In the full incremental case, there would never be a nice way to unsmash a decl &#8212; but we definitely need this.</p>
<p>Instead I&#8217;m going to have a per-thread hash table mapping unmodified decls to their smashed variants.  Then I&#8217;ll audit the C front end to add hash lookups everywhere they are needed.  Not fun but it will give the correct answer in all the scenarios.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tom</title>
		<link>http://tromey.com/blog/?p=277&#038;cpage=1#comment-48167</link>
		<dc:creator>tom</dc:creator>
		<pubDate>Sat, 30 Jun 2007 07:52:11 +0000</pubDate>
		<guid isPermaLink="false">http://tromey.com/blog/?p=277#comment-48167</guid>
		<description><![CDATA[Maybe another idea is to change the game a little bit -- warn if two decls are smashed, and use the combined decl.  Underlying this approach is the hope that smashing decls is uncommon.  Some emperical data here would be useful.]]></description>
		<content:encoded><![CDATA[<p>Maybe another idea is to change the game a little bit &#8212; warn if two decls are smashed, and use the combined decl.  Underlying this approach is the hope that smashing decls is uncommon.  Some emperical data here would be useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tom</title>
		<link>http://tromey.com/blog/?p=277&#038;cpage=1#comment-48107</link>
		<dc:creator>tom</dc:creator>
		<pubDate>Fri, 29 Jun 2007 21:14:01 +0000</pubDate>
		<guid isPermaLink="false">http://tromey.com/blog/?p=277#comment-48107</guid>
		<description><![CDATA[The problem with using copy-on-write is kind of obscure.  I keep forgetting it :(.  Anyway, I think the problem is that GCC compares trees like this using ==, so object identity is important.  This is why smashing decls together is done, and this is why all the uses have to refer to a single decl.  I need to investigate this a bit more -- maybe this is the weak point where a change can be made.

Alternatively I thought of a complicated solution involving recording all the hunks that modify a decl, and then only allowing hunk reuse if all the modifying hunks are used by the compilation unit.  This is kind of nasty though, and harder to reason about; for instance one of these hunks may have unsatisfied dependencies, so you may need a relatively hairy dependency check, or you may need to do all the dependency checks before doing any parsing.]]></description>
		<content:encoded><![CDATA[<p>The problem with using copy-on-write is kind of obscure.  I keep forgetting it <img src='http://tromey.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> .  Anyway, I think the problem is that GCC compares trees like this using ==, so object identity is important.  This is why smashing decls together is done, and this is why all the uses have to refer to a single decl.  I need to investigate this a bit more &#8212; maybe this is the weak point where a change can be made.</p>
<p>Alternatively I thought of a complicated solution involving recording all the hunks that modify a decl, and then only allowing hunk reuse if all the modifying hunks are used by the compilation unit.  This is kind of nasty though, and harder to reason about; for instance one of these hunks may have unsatisfied dependencies, so you may need a relatively hairy dependency check, or you may need to do all the dependency checks before doing any parsing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander Larsson</title>
		<link>http://tromey.com/blog/?p=277&#038;cpage=1#comment-48016</link>
		<dc:creator>Alexander Larsson</dc:creator>
		<pubDate>Fri, 29 Jun 2007 06:51:48 +0000</pubDate>
		<guid isPermaLink="false">http://tromey.com/blog/?p=277#comment-48016</guid>
		<description><![CDATA[Yeah, some form of copy-on-write seems to be the best way. Perhaps saving the old version in some form of backlink and somehow tagging each version so you know what compilation unit the modifications came from.]]></description>
		<content:encoded><![CDATA[<p>Yeah, some form of copy-on-write seems to be the best way. Perhaps saving the old version in some form of backlink and somehow tagging each version so you know what compilation unit the modifications came from.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Ballard</title>
		<link>http://tromey.com/blog/?p=277&#038;cpage=1#comment-47959</link>
		<dc:creator>Stuart Ballard</dc:creator>
		<pubDate>Thu, 28 Jun 2007 22:24:19 +0000</pubDate>
		<guid isPermaLink="false">http://tromey.com/blog/?p=277#comment-47959</guid>
		<description><![CDATA[How about every time the compiler wants to modify one of these objects, take a copy of it, and use the copy for the thread that needs to modify it, leaving all other instances sharing it using the unmodified original.

If it&#039;s possible to detect how many times it&#039;s already being shared you could optimize away the copy in the case where it&#039;s not, yet, but you&#039;d have to add a flag to indicate that if it&#039;s to be shared in future it&#039;ll need to be recreated fresh...]]></description>
		<content:encoded><![CDATA[<p>How about every time the compiler wants to modify one of these objects, take a copy of it, and use the copy for the thread that needs to modify it, leaving all other instances sharing it using the unmodified original.</p>
<p>If it&#8217;s possible to detect how many times it&#8217;s already being shared you could optimize away the copy in the case where it&#8217;s not, yet, but you&#8217;d have to add a flag to indicate that if it&#8217;s to be shared in future it&#8217;ll need to be recreated fresh&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
