<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-1158</id>
	<title>Nabble - gcc - Help</title>
	<updated>2009-11-30T05:54:20Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/gcc---Help-f1158.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/gcc---Help-f1158.html" />
	<subtitle type="html">Looking for help in building or using GCC.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26575097</id>
	<title>Re: Efficient detection of signed overflow?</title>
	<published>2009-11-30T05:54:20Z</published>
	<updated>2009-11-30T05:54:20Z</updated>
	<author>
		<name>me22</name>
	</author>
	<content type="html">2009/11/30 Florian Weimer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26575097&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;fw@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; On Sun, Nov 29, 2009 at 9:00 PM, me22 &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26575097&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;me22.ca@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; What about using (long)((unsigned long)a + (unsigned long)b) or
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; something to get around the UB?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You'd also have to compare against (1 &amp;lt;&amp;lt; (sizeof(long) * CHAR_BITS -
&lt;br&gt;&amp;gt; 1)) instead of 0, pessimizing the code somewhat.
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Why? &amp;nbsp;If numbers are 2s-complement, the cast back to a signed type is
&lt;br&gt;well-defined, isn't it?
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Efficient-detection-of-signed-overflow--tp26565373p26575097.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26572927</id>
	<title>Re: Using core\cores specification</title>
	<published>2009-11-30T03:09:39Z</published>
	<updated>2009-11-30T03:09:39Z</updated>
	<author>
		<name>Harald Servat-3</name>
	</author>
	<content type="html">-----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;Hash: SHA1
&lt;br&gt;&lt;br&gt;En/na Nicolas BENOIT ha escrit:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; alanklm wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Harald Servat-3 wrote:
&lt;br&gt;&amp;gt; En/na alanklm ha escrit:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Do somebody know if there is some possibility in gcc to set on which
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fixed
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; cores of multi-core processor I want to execute my program?
&lt;br&gt;&amp;gt; I'm afraid that this feature depends on the OS not on gcc itself.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; For example, FreeBSD has the cpuset command and calls.
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=2&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=2&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=1&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=1&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Other OSes may have other commands/calls.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Regards.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thanks a lot. May be you know same command for Debian. &amp;nbsp;(4.0 or 5.0)
&lt;/div&gt;&lt;br&gt;&amp;gt; On Linux, this functionnality is notably described in the manpages of
&lt;br&gt;&amp;gt; sched_setaffinity
&lt;br&gt;&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; N. BENOIT
&lt;br&gt;&lt;br&gt;Also, taskset (1) may help you.
&lt;br&gt;&lt;br&gt;Regards.
&lt;br&gt;-----BEGIN PGP SIGNATURE-----
&lt;br&gt;Version: GnuPG v2.0.9 (GNU/Linux)
&lt;br&gt;&lt;br&gt;iEYEARECAAYFAksTp/MACgkQwMPeuqUCg9ws9wCdFrUkptYaBwvZd58+F8oz8+gm
&lt;br&gt;o/cAn1lKhlvRM17zyamzMa29vgP8Q6SZ
&lt;br&gt;=LNaq
&lt;br&gt;-----END PGP SIGNATURE-----
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Using-core%5Ccores-specification-tp26571154p26572927.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26572874</id>
	<title>Re: Using core\cores specification</title>
	<published>2009-11-30T03:07:07Z</published>
	<updated>2009-11-30T03:07:07Z</updated>
	<author>
		<name>Nicolas BENOIT-2</name>
	</author>
	<content type="html">alanklm wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Harald Servat-3 wrote:
&lt;br&gt;&amp;gt;&amp;gt; -----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;&amp;gt;&amp;gt; Hash: SHA1
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; En/na alanklm ha escrit:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Do somebody know if there is some possibility in gcc to set on which
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; fixed
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; cores of multi-core processor I want to execute my program?
&lt;br&gt;&amp;gt;&amp;gt; I'm afraid that this feature depends on the OS not on gcc itself.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; For example, FreeBSD has the cpuset command and calls.
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=2&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=2&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=1&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=1&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Other OSes may have other commands/calls.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Regards.
&lt;br&gt;&amp;gt;&amp;gt; -----BEGIN PGP SIGNATURE-----
&lt;br&gt;&amp;gt;&amp;gt; Version: GnuPG v2.0.9 (GNU/Linux)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; iEYEARECAAYFAksTlmIACgkQwMPeuqUCg9y66gCeOznWYFnyOxP+ld8mss3iWGYc
&lt;br&gt;&amp;gt;&amp;gt; TUUAmgOnOUv9v/rPpmX8TQnw2gPQ1iRn
&lt;br&gt;&amp;gt;&amp;gt; =yv5u
&lt;br&gt;&amp;gt;&amp;gt; -----END PGP SIGNATURE-----
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks a lot. 
&lt;br&gt;&amp;gt; May be you know same command for Debian. &amp;nbsp;(4.0 or 5.0)
&lt;/div&gt;&lt;br&gt;On Linux, this functionnality is notably described in the manpages of 
&lt;br&gt;sched_setaffinity
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;N. BENOIT
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Using-core%5Ccores-specification-tp26571154p26572874.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26572424</id>
	<title>Re: Using core\cores specification</title>
	<published>2009-11-30T02:32:30Z</published>
	<updated>2009-11-30T02:32:30Z</updated>
	<author>
		<name>alanklm</name>
	</author>
	<content type="html">&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Harald Servat-3 wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;-----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;Hash: SHA1
&lt;br&gt;&lt;br&gt;En/na alanklm ha escrit:
&lt;br&gt;&amp;gt; Do somebody know if there is some possibility in gcc to set on which fixed
&lt;br&gt;&amp;gt; cores of multi-core processor I want to execute my program?
&lt;br&gt;&lt;br&gt;I'm afraid that this feature depends on the OS not on gcc itself.
&lt;br&gt;&lt;br&gt;For example, FreeBSD has the cpuset command and calls.
&lt;br&gt;&lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=2&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=2&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=1&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=1&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&lt;/a&gt;&lt;br&gt;&lt;br&gt;Other OSes may have other commands/calls.
&lt;br&gt;&lt;br&gt;Regards.
&lt;br&gt;-----BEGIN PGP SIGNATURE-----
&lt;br&gt;Version: GnuPG v2.0.9 (GNU/Linux)
&lt;br&gt;&lt;br&gt;iEYEARECAAYFAksTlmIACgkQwMPeuqUCg9y66gCeOznWYFnyOxP+ld8mss3iWGYc
&lt;br&gt;TUUAmgOnOUv9v/rPpmX8TQnw2gPQ1iRn
&lt;br&gt;=yv5u
&lt;br&gt;-----END PGP SIGNATURE-----
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
Thanks a lot. 
&lt;br&gt;May be you know same command for Debian. &amp;nbsp;(4.0 or 5.0)</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Using-core%5Ccores-specification-tp26571154p26572424.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26571908</id>
	<title>Re: Using core\cores specification</title>
	<published>2009-11-30T01:54:42Z</published>
	<updated>2009-11-30T01:54:42Z</updated>
	<author>
		<name>Harald Servat-3</name>
	</author>
	<content type="html">-----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;Hash: SHA1
&lt;br&gt;&lt;br&gt;En/na alanklm ha escrit:
&lt;br&gt;&amp;gt; Do somebody know if there is some possibility in gcc to set on which fixed
&lt;br&gt;&amp;gt; cores of multi-core processor I want to execute my program?
&lt;br&gt;&lt;br&gt;I'm afraid that this feature depends on the OS not on gcc itself.
&lt;br&gt;&lt;br&gt;For example, FreeBSD has the cpuset command and calls.
&lt;br&gt;&lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=2&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=2&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=1&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.freebsd.org/cgi/man.cgi?query=cpuset&amp;sektion=1&amp;apropos=0&amp;manpath=FreeBSD+8.0-RELEASE&lt;/a&gt;&lt;br&gt;&lt;br&gt;Other OSes may have other commands/calls.
&lt;br&gt;&lt;br&gt;Regards.
&lt;br&gt;-----BEGIN PGP SIGNATURE-----
&lt;br&gt;Version: GnuPG v2.0.9 (GNU/Linux)
&lt;br&gt;&lt;br&gt;iEYEARECAAYFAksTlmIACgkQwMPeuqUCg9y66gCeOznWYFnyOxP+ld8mss3iWGYc
&lt;br&gt;TUUAmgOnOUv9v/rPpmX8TQnw2gPQ1iRn
&lt;br&gt;=yv5u
&lt;br&gt;-----END PGP SIGNATURE-----
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Using-core%5Ccores-specification-tp26571154p26571908.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26571154</id>
	<title>Using core\cores specification</title>
	<published>2009-11-30T01:18:57Z</published>
	<updated>2009-11-30T01:18:57Z</updated>
	<author>
		<name>alanklm</name>
	</author>
	<content type="html">Do somebody know if there is some possibility in gcc to set on which fixed cores of multi-core processor I want to execute my program?</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Using-core%5Ccores-specification-tp26571154p26571154.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26570182</id>
	<title>Re: Efficient detection of signed overflow?</title>
	<published>2009-11-29T22:36:53Z</published>
	<updated>2009-11-29T22:36:53Z</updated>
	<author>
		<name>Florian Weimer</name>
	</author>
	<content type="html">* Mark Dickinson:
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Any suggestions for improvements over this?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Use -fwrapv and your first version.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; gcc isn't the only compiler that's going to have to compile
&lt;br&gt;&amp;gt; this code, so it still needs to be fixed to avoid undefined
&lt;br&gt;&amp;gt; behaviour
&lt;br&gt;&lt;br&gt;Most compiler support something like -fwrapv.
&lt;br&gt;&lt;br&gt;&amp;gt; On Sun, Nov 29, 2009 at 9:00 PM, me22 &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26570182&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;me22.ca@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; What about using (long)((unsigned long)a + (unsigned long)b) or
&lt;br&gt;&amp;gt;&amp;gt; something to get around the UB?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yep, that looks like the solution. &amp;nbsp;Thanks!
&lt;br&gt;&lt;br&gt;You'd also have to compare against (1 &amp;lt;&amp;lt; (sizeof(long) * CHAR_BITS -
&lt;br&gt;1)) instead of 0, pessimizing the code somewhat.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Efficient-detection-of-signed-overflow--tp26565373p26570182.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26566686</id>
	<title>Re: Efficient detection of signed overflow?</title>
	<published>2009-11-29T14:00:30Z</published>
	<updated>2009-11-29T14:00:30Z</updated>
	<author>
		<name>Mark Dickinson</name>
	</author>
	<content type="html">On Sun, Nov 29, 2009 at 8:53 PM, Florian Weimer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26566686&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;fw@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; * Mark Dickinson:
&lt;br&gt;&amp;gt; [...]
&lt;br&gt;&amp;gt;&amp;gt; if ((x^a) &amp;lt; 0 &amp;&amp; (x^b) &amp;lt; 0)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Would this test be better?  I think it's equivalent, and it saves a
&lt;br&gt;&amp;gt; comparison.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  if (((x ^ a) &amp; (x ^ b)) &amp;lt; 0)
&lt;br&gt;&lt;br&gt;Mmm. &amp;nbsp;Quite possibly, yes. &amp;nbsp;I'll do some timings.
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; Any suggestions for improvements over this?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Use -fwrapv and your first version.
&lt;br&gt;&lt;br&gt;gcc isn't the only compiler that's going to have to compile
&lt;br&gt;this code, so it still needs to be fixed to avoid undefined
&lt;br&gt;behaviour (and I'm worried about -fwrapv inhibiting optimizations
&lt;br&gt;elsewhere in the codebase). &amp;nbsp;But I guess that casting everything in
&lt;br&gt;sight to unsigned long and then casting the eventual result
&lt;br&gt;back to long, as me22 suggests, would be pretty much equivalent.
&lt;br&gt;&lt;br&gt;On Sun, Nov 29, 2009 at 9:00 PM, me22 &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26566686&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;me22.ca@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; What about using (long)((unsigned long)a + (unsigned long)b) or
&lt;br&gt;&amp;gt; something to get around the UB?
&lt;br&gt;&lt;br&gt;Yep, that looks like the solution. &amp;nbsp;Thanks!
&lt;br&gt;&lt;br&gt;Mark
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Efficient-detection-of-signed-overflow--tp26565373p26566686.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26566045</id>
	<title>Re: Efficient detection of signed overflow?</title>
	<published>2009-11-29T13:00:57Z</published>
	<updated>2009-11-29T13:00:57Z</updated>
	<author>
		<name>me22</name>
	</author>
	<content type="html">2009/11/29 Mark Dickinson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26566045&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dickinsm@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This code is wrong, I think, because it depends on undefined
&lt;br&gt;&amp;gt; behaviour.  I'm wondering how best to rewrite it so that (a)
&lt;br&gt;&amp;gt; the replacement code is correct and portable C89, and (b)
&lt;br&gt;&amp;gt; there's a reasonable chance of gcc compiling it to efficient
&lt;br&gt;&amp;gt; assembler on common platforms.
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;What about using (long)((unsigned long)a + (unsigned long)b) or
&lt;br&gt;something to get around the UB?
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Efficient-detection-of-signed-overflow--tp26565373p26566045.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26565964</id>
	<title>Re: Efficient detection of signed overflow?</title>
	<published>2009-11-29T12:53:49Z</published>
	<updated>2009-11-29T12:53:49Z</updated>
	<author>
		<name>Florian Weimer</name>
	</author>
	<content type="html">* Mark Dickinson:
&lt;br&gt;&lt;br&gt;&amp;gt; long a, b, x;
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; x = a + b;
&lt;br&gt;&amp;gt; if ((x^a) &amp;lt; 0 &amp;&amp; (x^b) &amp;lt; 0)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; goto deal_with_overflow;
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&lt;br&gt;Would this test be better? &amp;nbsp;I think it's equivalent, and it saves a
&lt;br&gt;comparison.
&lt;br&gt;&lt;br&gt;&amp;nbsp; if (((x ^ a) &amp; (x ^ b)) &amp;lt; 0)
&lt;br&gt;&lt;br&gt;&amp;gt; Any suggestions for improvements over this?
&lt;br&gt;&lt;br&gt;Use -fwrapv and your first version.
&lt;br&gt;&lt;br&gt;&amp;gt; Are there any common C code constructs that gcc would compile to a
&lt;br&gt;&amp;gt; jump-on-overflow instruction on x86?
&lt;br&gt;&lt;br&gt;I don't think so. &amp;nbsp;Without support throughout GCC, anything in this
&lt;br&gt;area (like a builtin) would mostly act as an optimization barrier.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Efficient-detection-of-signed-overflow--tp26565373p26565964.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26565373</id>
	<title>Efficient detection of signed overflow?</title>
	<published>2009-11-29T11:51:48Z</published>
	<updated>2009-11-29T11:51:48Z</updated>
	<author>
		<name>Mark Dickinson</name>
	</author>
	<content type="html">I've just found myself looking at a piece of C code like the
&lt;br&gt;snippet given below. &amp;nbsp;It's supposed to be adding two longs
&lt;br&gt;and doing something special when the sum overflows.
&lt;br&gt;Here a and b could have any value, but are likely to be small
&lt;br&gt;in the common case. &amp;nbsp;The snippet occurs in a fairly performance-
&lt;br&gt;critical section of code.
&lt;br&gt;&lt;br&gt;long a, b, x;
&lt;br&gt;...
&lt;br&gt;x = a + b;
&lt;br&gt;if ((x^a) &amp;lt; 0 &amp;&amp; (x^b) &amp;lt; 0)
&lt;br&gt;&amp;nbsp; &amp;nbsp; goto deal_with_overflow;
&lt;br&gt;...
&lt;br&gt;&lt;br&gt;This code is wrong, I think, because it depends on undefined
&lt;br&gt;behaviour. &amp;nbsp;I'm wondering how best to rewrite it so that (a)
&lt;br&gt;the replacement code is correct and portable C89, and (b)
&lt;br&gt;there's a reasonable chance of gcc compiling it to efficient
&lt;br&gt;assembler on common platforms.
&lt;br&gt;&lt;br&gt;A bullet-proof solution (valid even in the presence of ones'
&lt;br&gt;complement machines, trap representations, etc.) is
&lt;br&gt;something like:
&lt;br&gt;&lt;br&gt;if ((a &amp;gt;= 0 &amp;&amp; 0UL + a &amp;gt; (unsigned long)LONG_MAX - b) ||
&lt;br&gt;&amp;nbsp; &amp;nbsp; (a &amp;lt; 0 &amp;&amp; 0UL - a &amp;gt; b - (unsigned long)LONG_MIN))
&lt;br&gt;&amp;nbsp; &amp;nbsp; goto deal_with_overflow;
&lt;br&gt;x = a + b;
&lt;br&gt;&lt;br&gt;but, not surprisingly, this generates rather inefficient assembler
&lt;br&gt;(with gcc-4.4 -O3).
&lt;br&gt;&lt;br&gt;Any suggestions for improvements over this?
&lt;br&gt;&lt;br&gt;On x86 or x86-64, the optimal generated code would
&lt;br&gt;presumably consist of just two instructions: &amp;nbsp;an addition
&lt;br&gt;followed by a jump-on-overflow. &amp;nbsp;Unfortunately, using
&lt;br&gt;inline assembly isn't really an option here. &amp;nbsp;Are there
&lt;br&gt;any common C code constructs that gcc would compile
&lt;br&gt;to a jump-on-overflow instruction on x86?
&lt;br&gt;&lt;br&gt;Mark
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Efficient-detection-of-signed-overflow--tp26565373p26565373.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26556883</id>
	<title>Re: cache optimization</title>
	<published>2009-11-28T12:51:39Z</published>
	<updated>2009-11-28T12:51:39Z</updated>
	<author>
		<name>Tim Prince-4</name>
	</author>
	<content type="html">£ukasz wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; --- On Thu, 11/26/09, Tim Prince &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26556883&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;n8tm@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; From: Tim Prince &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26556883&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;n8tm@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Subject: Re: cache optimization
&lt;br&gt;&amp;gt;&amp;gt; To: &amp;quot;£ukasz&amp;quot; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26556883&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;blurrpp@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Cc: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26556883&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gcc-help@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt; Date: Thursday, November 26, 2009, 4:38 PM
&lt;br&gt;&amp;gt;&amp;gt; £ukasz wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Hi I want to learn how to optimaze cache usage in gcc.
&lt;br&gt;&amp;gt;&amp;gt; I find builtin function __builtin_prefetch which should
&lt;br&gt;&amp;gt;&amp;gt; prefetch datas to cache .. so i use cannonical :) example of
&lt;br&gt;&amp;gt;&amp;gt; vector addition.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;a[i] = a[i] + b[i];
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;__builtin_prefetch
&lt;br&gt;&amp;gt;&amp;gt; (&amp;a[i+1], 1, 1);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;__builtin_prefetch
&lt;br&gt;&amp;gt;&amp;gt; (&amp;b[i+1], 0, 1);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* ... */
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; and compile it with gcc without special options ....
&lt;br&gt;&amp;gt;&amp;gt; but its slower than
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;a[i] = a[i] + b[i];
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* ... */
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; so maybe I should compile it with soem extra options
&lt;br&gt;&amp;gt;&amp;gt; to have advantage of cache prefatching
&lt;br&gt;&amp;gt;&amp;gt; ?(-fprefetch-loop-array doenst works )
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Under normal settings, on CPUs of the last 6 years or so,
&lt;br&gt;&amp;gt;&amp;gt; you are prefetching what has already been prefetched by
&lt;br&gt;&amp;gt;&amp;gt; hardware prefetcher. &amp;nbsp;If your search engine doesn't
&lt;br&gt;&amp;gt;&amp;gt; find you many success stories about the use of this feature,
&lt;br&gt;&amp;gt;&amp;gt; that might be a clue that it involves some serious
&lt;br&gt;&amp;gt;&amp;gt; investigation. You would look for slow spots in your code
&lt;br&gt;&amp;gt;&amp;gt; which don't fall in the usual hardware supported prefetch
&lt;br&gt;&amp;gt;&amp;gt; patterns (linear access with not too large a stride, or
&lt;br&gt;&amp;gt;&amp;gt; pairs of cache lines), and experiment with fetching the data
&lt;br&gt;&amp;gt;&amp;gt; sufficiently far in advance for it to do some good, without
&lt;br&gt;&amp;gt;&amp;gt; exceeding your cache capacity.
&lt;br&gt;&amp;gt;&amp;gt; I do see a &amp;quot;success story&amp;quot; about prefetching for a reversed
&lt;br&gt;&amp;gt;&amp;gt; loop. As the author doesn't divulge the CPU in use, one
&lt;br&gt;&amp;gt;&amp;gt; suspects it might be something like the old Athlon32 which
&lt;br&gt;&amp;gt;&amp;gt; supported hardware prefetch only in the forward direction.
&lt;br&gt;&amp;gt;&amp;gt; Don't you like advice which assumes no one will ever use a
&lt;br&gt;&amp;gt;&amp;gt; CPU different (e.g. more up to date) than the author's
&lt;br&gt;&amp;gt;&amp;gt; favorite?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You are completely right, in this example gcc compiler change code to branch assembly, which ofcourse is already &amp;quot;predicted&amp;quot; ( means forward NOT TAKEN, backward TAKEN), but im looking for some nice example for modern procesors which would realy works I mean speed program(im searching net actualy ). In Intel Optimization Reference Manual they advice to use PREFETCH to any predicable memory access patern, but as you already mensioned some patern processor can predict by him self.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;/div&gt;Prefetch intrinsics might be effective in a case such as
&lt;br&gt;&lt;br&gt;for(i=0; i&amp;lt;n; ++i)
&lt;br&gt;&amp;nbsp; &amp;nbsp; a[indx[i]] += b[indx[i]];
&lt;br&gt;&lt;br&gt;but, as another responder said, you must recognize that you will be 
&lt;br&gt;fetching whole cache lines, or pairs of cache lines, and may need half a 
&lt;br&gt;dozen in advance. &amp;nbsp;If you are running on an Atom (non-out-of-order), you 
&lt;br&gt;might expect entirely different results, and different optimum strategy, 
&lt;br&gt;from a CPU with a large out-of-order queue.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-optimization-tp26529275p26556883.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26555693</id>
	<title>Re: cache optimization</title>
	<published>2009-11-28T10:33:26Z</published>
	<updated>2009-11-28T10:33:26Z</updated>
	<author>
		<name>gazzel</name>
	</author>
	<content type="html">&amp;quot;(remember, adding instructions make your code slower)&amp;quot;
&lt;br&gt;&lt;br&gt;I would agree with you totaly two years ago, before i started writing GPU programs. There, programs which copy special part of data to SHARE memory, and has about 20% more instructions because of it, works 10 times faster than those without. Thanks for answer and if you have some nice example of speeding up CPU programs with using prefatching, or some good literature please give link :).
&lt;br&gt;&lt;br&gt;CentCollector :)
&lt;br&gt;&lt;br&gt;--- On Thu, 11/26/09, Harald Servat &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26555693&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;harald.servat@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; From: Harald Servat &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26555693&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;harald.servat@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Subject: Re: cache optimization
&lt;br&gt;&amp;gt; To: &amp;quot;£ukasz&amp;quot; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26555693&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;blurrpp@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cc: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26555693&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gcc-help@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Date: Thursday, November 26, 2009, 4:38 PM
&lt;br&gt;&amp;gt; -----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;&amp;gt; Hash: SHA1
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Although there are other factors that may apply, you must
&lt;br&gt;&amp;gt; consider that
&lt;br&gt;&amp;gt; prefeteching the next element may be not enough for
&lt;br&gt;&amp;gt; current
&lt;br&gt;&amp;gt; microprocessors. First, I'm pretty sure that the processor
&lt;br&gt;&amp;gt; would have
&lt;br&gt;&amp;gt; the entire cache line once you bring some data. And second,
&lt;br&gt;&amp;gt; nowadays,
&lt;br&gt;&amp;gt; micoprocessors have hardware prefetching that do the same
&lt;br&gt;&amp;gt; work for you
&lt;br&gt;&amp;gt; without the need of adding extra instructions (remember,
&lt;br&gt;&amp;gt; adding
&lt;br&gt;&amp;gt; instructions make your code slower). Also consider that
&lt;br&gt;&amp;gt; the
&lt;br&gt;&amp;gt; microprocessor has other out-of-order special circuitry
&lt;br&gt;&amp;gt; that may allow
&lt;br&gt;&amp;gt; it to be working on &amp;quot;future&amp;quot; iterations while waiting on a
&lt;br&gt;&amp;gt; cache miss.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So I think that you may prefetch data which is farther.
&lt;br&gt;&amp;gt; With current gap
&lt;br&gt;&amp;gt; between micro and memory speeds, I wouldn't be too
&lt;br&gt;&amp;gt; impressed if you had
&lt;br&gt;&amp;gt; to go at 7 or 8 cache lines away.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Just my .02 euro cents :)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; En/na £ukasz ha escrit:
&lt;br&gt;&amp;gt; &amp;gt; Hi I want to learn how to optimaze cache usage in gcc.
&lt;br&gt;&amp;gt; I find builtin function __builtin_prefetch which should
&lt;br&gt;&amp;gt; prefetch datas to cache .. so i use cannonical :) example of
&lt;br&gt;&amp;gt; vector addition.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;gt; &amp;gt;   {
&lt;br&gt;&amp;gt; &amp;gt;     a[i] = a[i] + b[i];
&lt;br&gt;&amp;gt; &amp;gt;     __builtin_prefetch
&lt;br&gt;&amp;gt; (&amp;a[i+1], 1, 1);
&lt;br&gt;&amp;gt; &amp;gt;     __builtin_prefetch
&lt;br&gt;&amp;gt; (&amp;b[i+1], 0, 1);
&lt;br&gt;&amp;gt; &amp;gt;     /* ... */
&lt;br&gt;&amp;gt; &amp;gt;   }
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; and compile it with gcc without special options ....
&lt;br&gt;&amp;gt; but its slower than
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;gt; &amp;gt;   {
&lt;br&gt;&amp;gt; &amp;gt;     a[i] = a[i] + b[i];
&lt;br&gt;&amp;gt; &amp;gt;     /* ... */
&lt;br&gt;&amp;gt; &amp;gt;   }
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; so maybe I should compile it with soem extra options
&lt;br&gt;&amp;gt; to have advantage of cache prefatching
&lt;br&gt;&amp;gt; ?(-fprefetch-loop-array doenst works )
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -----BEGIN PGP SIGNATURE-----
&lt;br&gt;&amp;gt; Version: GnuPG v2.0.9 (GNU/Linux)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; iEYEARECAAYFAksOoOsACgkQwMPeuqUCg9yj9wCbBd7DxNBKk9uNzV5xz4r66He4
&lt;br&gt;&amp;gt; r9gAnRncLhV0SYr6MgoUz7qG+hSL8S9b
&lt;br&gt;&amp;gt; =t8mz
&lt;br&gt;&amp;gt; -----END PGP SIGNATURE-----
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-optimization-tp26529275p26555693.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26555593</id>
	<title>Re: cache optimization</title>
	<published>2009-11-28T10:18:52Z</published>
	<updated>2009-11-28T10:18:52Z</updated>
	<author>
		<name>gazzel</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;--- On Thu, 11/26/09, Tim Prince &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26555593&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;n8tm@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; From: Tim Prince &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26555593&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;n8tm@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Subject: Re: cache optimization
&lt;br&gt;&amp;gt; To: &amp;quot;£ukasz&amp;quot; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26555593&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;blurrpp@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cc: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26555593&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gcc-help@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Date: Thursday, November 26, 2009, 4:38 PM
&lt;br&gt;&amp;gt; £ukasz wrote:
&lt;br&gt;&amp;gt; &amp;gt; Hi I want to learn how to optimaze cache usage in gcc.
&lt;br&gt;&amp;gt; I find builtin function __builtin_prefetch which should
&lt;br&gt;&amp;gt; prefetch datas to cache .. so i use cannonical :) example of
&lt;br&gt;&amp;gt; vector addition.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;gt; &amp;gt;   {
&lt;br&gt;&amp;gt; &amp;gt;     a[i] = a[i] + b[i];
&lt;br&gt;&amp;gt; &amp;gt;     __builtin_prefetch
&lt;br&gt;&amp;gt; (&amp;a[i+1], 1, 1);
&lt;br&gt;&amp;gt; &amp;gt;     __builtin_prefetch
&lt;br&gt;&amp;gt; (&amp;b[i+1], 0, 1);
&lt;br&gt;&amp;gt; &amp;gt;     /* ... */
&lt;br&gt;&amp;gt; &amp;gt;   }
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; and compile it with gcc without special options ....
&lt;br&gt;&amp;gt; but its slower than
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;gt; &amp;gt;   {
&lt;br&gt;&amp;gt; &amp;gt;     a[i] = a[i] + b[i];
&lt;br&gt;&amp;gt; &amp;gt;     /* ... */
&lt;br&gt;&amp;gt; &amp;gt;   }
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; so maybe I should compile it with soem extra options
&lt;br&gt;&amp;gt; to have advantage of cache prefatching
&lt;br&gt;&amp;gt; ?(-fprefetch-loop-array doenst works )
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; Under normal settings, on CPUs of the last 6 years or so,
&lt;br&gt;&amp;gt; you are prefetching what has already been prefetched by
&lt;br&gt;&amp;gt; hardware prefetcher.  If your search engine doesn't
&lt;br&gt;&amp;gt; find you many success stories about the use of this feature,
&lt;br&gt;&amp;gt; that might be a clue that it involves some serious
&lt;br&gt;&amp;gt; investigation. You would look for slow spots in your code
&lt;br&gt;&amp;gt; which don't fall in the usual hardware supported prefetch
&lt;br&gt;&amp;gt; patterns (linear access with not too large a stride, or
&lt;br&gt;&amp;gt; pairs of cache lines), and experiment with fetching the data
&lt;br&gt;&amp;gt; sufficiently far in advance for it to do some good, without
&lt;br&gt;&amp;gt; exceeding your cache capacity.
&lt;br&gt;&amp;gt; I do see a &amp;quot;success story&amp;quot; about prefetching for a reversed
&lt;br&gt;&amp;gt; loop. As the author doesn't divulge the CPU in use, one
&lt;br&gt;&amp;gt; suspects it might be something like the old Athlon32 which
&lt;br&gt;&amp;gt; supported hardware prefetch only in the forward direction.
&lt;br&gt;&amp;gt; Don't you like advice which assumes no one will ever use a
&lt;br&gt;&amp;gt; CPU different (e.g. more up to date) than the author's
&lt;br&gt;&amp;gt; favorite?
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;You are completely right, in this example gcc compiler change code to branch assembly, which ofcourse is already &amp;quot;predicted&amp;quot; ( means forward NOT TAKEN, backward TAKEN), but im looking for some nice example for modern procesors which would realy works I mean speed program(im searching net actualy ). In Intel Optimization Reference Manual they advice to use PREFETCH to any predicable memory access patern, but as you already mensioned some patern processor can predict by him self.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-optimization-tp26529275p26555593.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26555008</id>
	<title>Re: GDB in Lenny</title>
	<published>2009-11-28T09:23:27Z</published>
	<updated>2009-11-28T09:23:27Z</updated>
	<author>
		<name>Sanyi</name>
	</author>
	<content type="html">&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;I Rattan wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;&lt;br&gt;On Fri, 27 Nov 2009, Sanyi wrote:
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi .
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm trying to debug my example program with GDB. My question is why GDB do
&lt;br&gt;&amp;gt; not show the simbolic information. (e.g Line number and vars)
&lt;br&gt;&lt;br&gt;Did you compile with -g flag?
&lt;br&gt;-ishwar
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
Yes I did. Finaly I found the problem. I found the solution described here 
&lt;br&gt;&lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=227097&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=227097&lt;/a&gt;&lt;br&gt;&lt;br&gt;I have installed the libc6-dbg_2.3.2.ds1-12_i386.deb package from the ftp repo and now it's working 
&lt;br&gt;&lt;br&gt;I don't know why in the package list is not mentioned 
&lt;br&gt;&lt;a href=&quot;http://packages.debian.org/lenny/gdb&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://packages.debian.org/lenny/gdb&lt;/a&gt;&lt;br&gt;&lt;br&gt;Now after i ran GDB . It looks like this
&lt;br&gt;server:/home/sanyi/ALP/ch01# gdb reciprocal
&lt;br&gt;GNU gdb 6.8-debian
&lt;br&gt;Copyright (C) 2008 Free Software Foundation, Inc.
&lt;br&gt;License GPLv3+: GNU GPL version 3 or later &amp;lt;&lt;a href=&quot;http://gnu.org/licenses/gpl.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gnu.org/licenses/gpl.html&lt;/a&gt;&amp;gt;
&lt;br&gt;This is free software: you are free to change and redistribute it.
&lt;br&gt;There is NO WARRANTY, to the extent permitted by law. &amp;nbsp;Type &amp;quot;show copying&amp;quot;
&lt;br&gt;and &amp;quot;show warranty&amp;quot; for details.
&lt;br&gt;This GDB was configured as &amp;quot;i486-linux-gnu&amp;quot;...
&lt;br&gt;(gdb) run
&lt;br&gt;Starting program: /home/sanyi/ALP/ch01/reciprocal
&lt;br&gt;&lt;br&gt;Program received signal SIGSEGV, Segmentation fault.
&lt;br&gt;0xb7591358 in ____strtol_l_internal () from /lib/i686/cmov/libc.so.6
&lt;br&gt;(gdb) where
&lt;br&gt;#0 &amp;nbsp;0xb7591358 in ____strtol_l_internal () from /lib/i686/cmov/libc.so.6
&lt;br&gt;#1 &amp;nbsp;0xb75910c0 in strtol () from /lib/i686/cmov/libc.so.6
&lt;br&gt;#2 &amp;nbsp;0xb758de21 in atoi () from /lib/i686/cmov/libc.so.6
&lt;br&gt;#3 &amp;nbsp;0x08048485 in main (argc=1, argv=0xbfde47b4) at main.c:6
&lt;br&gt;(gdb)
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/GDB-in-Lenny-tp26545396p26555008.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26549801</id>
	<title>Re: GDB in Lenny</title>
	<published>2009-11-27T17:41:32Z</published>
	<updated>2009-11-27T17:41:32Z</updated>
	<author>
		<name>I Rattan</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;On Fri, 27 Nov 2009, Sanyi wrote:
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi .
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm trying to debug my example program with GDB. My question is why GDB do
&lt;br&gt;&amp;gt; not show the simbolic information. (e.g Line number and vars)
&lt;br&gt;&lt;br&gt;Did you compile with -g flag?
&lt;br&gt;-ishwar
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/GDB-in-Lenny-tp26545396p26549801.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26545396</id>
	<title>GDB in Lenny</title>
	<published>2009-11-27T14:43:04Z</published>
	<updated>2009-11-27T14:43:04Z</updated>
	<author>
		<name>Sanyi</name>
	</author>
	<content type="html">Hi .
&lt;br&gt;&lt;br&gt;I'm trying to debug my example program with GDB. My question is why GDB do not show the simbolic information. (e.g Line number and vars)
&lt;br&gt;&lt;br&gt;server:/home/sanyi/ALP/ch01# gdb reciprocal
&lt;br&gt;GNU gdb 6.8-debian
&lt;br&gt;Copyright (C) 2008 Free Software Foundation, Inc.
&lt;br&gt;License GPLv3+: GNU GPL version 3 or later &amp;lt;&lt;a href=&quot;http://gnu.org/licenses/gpl.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gnu.org/licenses/gpl.html&lt;/a&gt;&amp;gt;
&lt;br&gt;This is free software: you are free to change and redistribute it.
&lt;br&gt;There is NO WARRANTY, to the extent permitted by law. &amp;nbsp;Type &amp;quot;show copying&amp;quot;
&lt;br&gt;and &amp;quot;show warranty&amp;quot; for details.
&lt;br&gt;This GDB was configured as &amp;quot;i486-linux-gnu&amp;quot;...
&lt;br&gt;(gdb) run
&lt;br&gt;Starting program: /home/sanyi/ALP/ch01/reciprocal
&lt;br&gt;&lt;br&gt;Program received signal SIGSEGV, Segmentation fault.
&lt;br&gt;0xb7510358 in ?? () from /lib/i686/cmov/libc.so.6
&lt;br&gt;(gdb) where
&lt;br&gt;#0 &amp;nbsp;0xb7510358 in ?? () from /lib/i686/cmov/libc.so.6
&lt;br&gt;#1 &amp;nbsp;0xb77807c4 in ?? ()
&lt;br&gt;#2 &amp;nbsp;0x00000000 in ?? ()
&lt;br&gt;(gdb)
&lt;br&gt;&lt;br&gt;The source programs are :
&lt;br&gt;&lt;br&gt;main.c 
&lt;br&gt;&lt;br&gt;#include &amp;lt;stdio.h&amp;gt;
&lt;br&gt;#include &amp;lt;stdlib.h&amp;gt;
&lt;br&gt;#include &amp;quot;reciprocal.hpp&amp;quot;
&lt;br&gt;int main (int argc, char **argv){
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int i;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i = atoi (argv[1]);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf (&amp;quot;The reciprocal of %d is %g\n&amp;quot;,i,reciprocal (i));
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0;
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;reciprocal.cpp:
&lt;br&gt;&lt;br&gt;#include &amp;lt;cassert&amp;gt;
&lt;br&gt;#include &amp;quot;reciprocal.hpp&amp;quot;
&lt;br&gt;&lt;br&gt;double reciprocal (int i) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; assert (i != 0);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 1.0/i;
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;The Makefile:
&lt;br&gt;&lt;br&gt;reciprocal: main.o reciprocal.o
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g++ $(CFLAGS) -o reciprocal main.o reciprocal.o
&lt;br&gt;main.o: main.c reciprocal.hpp
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gcc $(CFLAGS) -c main.c
&lt;br&gt;reciprocal.o: reciprocal.cpp reciprocal.hpp
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g++ $(CFLAGS) -c reciprocal.cpp
&lt;br&gt;clean: 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rm -f *.o reciprocal
&lt;br&gt;&lt;br&gt;&lt;br&gt;I build the programm with make CFLAGS=-g
&lt;br&gt;&lt;br&gt;server:/home/sanyi/ALP/ch01# make CFLAGS=-g
&lt;br&gt;gcc -g -c main.c
&lt;br&gt;g++ -g -c reciprocal.cpp
&lt;br&gt;g++ -g -o reciprocal main.o reciprocal.o
&lt;br&gt;&lt;br&gt;gcc version:
&lt;br&gt;&lt;br&gt;server:/home/sanyi/ALP/ch01# gcc -v
&lt;br&gt;Using built-in specs.
&lt;br&gt;Target: i486-linux-gnu
&lt;br&gt;Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1.1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-cld --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
&lt;br&gt;Thread model: posix
&lt;br&gt;gcc version 4.3.2 (Debian 4.3.2-1.1)
&lt;br&gt;&lt;br&gt;Thank You </content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/GDB-in-Lenny-tp26545396p26545396.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26543150</id>
	<title>Re: Missing warning about uninitialized variable</title>
	<published>2009-11-27T06:29:34Z</published>
	<updated>2009-11-27T06:29:34Z</updated>
	<author>
		<name>Ian Lance Taylor-3</name>
	</author>
	<content type="html">David Sveningsson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26543150&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ext@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi, I recently ran into an issue with an uninitialized pointer which I
&lt;br&gt;&amp;gt; expected g++ to warn about.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; class Foo {
&lt;br&gt;&amp;gt; public:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Foo* a(){ return this; }
&lt;br&gt;&amp;gt; };
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; int main(int argc, const char*[] ){
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for ( int i = 0; i &amp;lt; 6; i++ ){
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Foo* foo = foo-&amp;gt;a();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This code compiles without any warnings (with -Wall) with both
&lt;br&gt;&amp;gt; g++-4.4.2 and g++-4.2.4. Removing the for-loop gives me a warning as
&lt;br&gt;&amp;gt; expected:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; foo.cpp: In function ‘int main(int, const char**)’:
&lt;br&gt;&amp;gt; foo.cpp:8: warning: ‘foo’ is used uninitialized in this function
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I know this case is a bit silly but it happened because of a typo and
&lt;br&gt;&amp;gt; went unnoticed for a while.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Is my reasoning flawed or should g++ emit a warning?
&lt;/div&gt;&lt;br&gt;You may get a warning with -Winit-self.
&lt;br&gt;&lt;br&gt;However, this sounds like a bug either way. &amp;nbsp;Please consider filing a
&lt;br&gt;bug report as described at &lt;a href=&quot;http://gcc.gnu.org/bugs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gcc.gnu.org/bugs/&lt;/a&gt;&amp;nbsp;.
&lt;br&gt;&lt;br&gt;Ian
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-warning-about-uninitialized-variable-tp26510225p26543150.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26543105</id>
	<title>Re: multiple definition error when compiling gcc-4.4.2</title>
	<published>2009-11-27T06:25:50Z</published>
	<updated>2009-11-27T06:25:50Z</updated>
	<author>
		<name>Ian Lance Taylor-3</name>
	</author>
	<content type="html">xinsan Chen &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26543105&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;xinsan.chen@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; checking for x86_64-unknown-linux-gnu-gcc... /home/cj/gcc-
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 442/./gcc/xgcc -B/home/cj/gcc-442/./gcc/ -B/home/cj/gcc-442/x86_64-
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; unknown-linux-gnu/bin/ -B/home/cj/gcc-442/x86_64-unknown-linux-gnu/lib/
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -isystem /home/cj/gcc-442/x86_64-unknown-linux-gnu/include -isystem
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /home/cj/gcc-442/x86_64-unknown-linux-gnu/sys-include
&lt;br&gt;&amp;gt; checking for suffix of object files... configure: error: in
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; `/home/cj/gcc-442/x86_64-unknown-linux-gnu/libgcc':
&lt;br&gt;&amp;gt; configure: error: cannot compute suffix of object files: cannot compile
&lt;br&gt;&amp;gt; See `config.log' for more details.
&lt;br&gt;&amp;gt; make[2]: *** [configure-stage1-target-libgcc] Error 1
&lt;/div&gt;&lt;br&gt;You need to look at x86_64-unknown-linux-gnu/libgcc/config.log. &amp;nbsp;You
&lt;br&gt;did send a config.log file, but it was the wrong one.
&lt;br&gt;&lt;br&gt;Ian
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/multiple-definition-error-when-compiling-gcc-4.4.2-tp26454935p26543105.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26540982</id>
	<title>mulhisi3</title>
	<published>2009-11-27T03:12:36Z</published>
	<updated>2009-11-27T03:12:36Z</updated>
	<author>
		<name>rohitgeek</name>
	</author>
	<content type="html">&lt;br&gt;Hi , i am an novice here.
&lt;br&gt;&lt;br&gt;What test case should i write so that gcc produce &amp;quot;mulhisi3&amp;quot; &amp;nbsp;pattern. mulsi3 , mulhi3 are working fine. I also have defined extendhisi2.
&lt;br&gt;&lt;br&gt;&lt;br&gt;thanks</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mulhisi3-tp26540982p26540982.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26538499</id>
	<title>Re: libstdc++.so without version information</title>
	<published>2009-11-26T22:54:46Z</published>
	<updated>2009-11-26T22:54:46Z</updated>
	<author>
		<name>Kai Ruottu-3</name>
	</author>
	<content type="html">Philipp Thomas wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, 25 Nov 2009 11:40:25 +0100, Christian Schaubschlaeger wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; root:# objdump -p libstdc++.so.6.0.8
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; libstdc++.so.6.0.8: &amp;nbsp; &amp;nbsp; file format elf32-i386
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ldconfig did find the library, but could not extract the version info
&lt;br&gt;&amp;gt;&amp;gt; (regarding CXXABI and GLIBCXX), since it's obviously not there. And
&lt;br&gt;&amp;gt;&amp;gt; I don't know why.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If there is no version info, you'll have to examine the build log of
&lt;br&gt;&amp;gt; your gcc (or start a new build and log that) and search for the
&lt;br&gt;&amp;gt; line(s) where libstdc+ is itself linked. I haven't looked at gcc
&lt;br&gt;&amp;gt; makefiles for a long time but ld should be passed a version script
&lt;br&gt;&amp;gt; that contains the versioning info ld will then put into the library.
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;Examining the 'libstdc++-v3/config.log' alone would tell the possible 
&lt;br&gt;reason. &amp;nbsp;My (re)build of
&lt;br&gt;cross-gcc-4.1.2 for SuSE 10.3 (no version info there earlier) told in 
&lt;br&gt;the $target/libstdc++-v3/config.log :
&lt;br&gt;&lt;br&gt;configure:87446: WARNING: === Linker version 1750 is too old for
&lt;br&gt;configure:87448: WARNING: === full symbol versioning support in this 
&lt;br&gt;release of GCC.
&lt;br&gt;configure:87450: WARNING: === You would need to upgrade your binutils to 
&lt;br&gt;version
&lt;br&gt;configure:87452: WARNING: === 21400 or later and rebuild GCC.
&lt;br&gt;configure:87454: WARNING: === Symbol versioning will be disabled.
&lt;br&gt;&lt;br&gt;The case really was that the earlier buggy &amp;nbsp;gcc-4.1.2 &amp;nbsp;toolchain had &amp;nbsp;
&lt;br&gt;the &amp;nbsp;:
&lt;br&gt;&lt;br&gt;[root@Dell i686-suse-linux10.3]# bin/ld -V
&lt;br&gt;GNU ld (Linux/GNU Binutils) 2.17.50.0.16.20070511
&lt;br&gt;&amp;nbsp;Supported emulations:
&lt;br&gt;&amp;nbsp; elf_i386
&lt;br&gt;&amp;nbsp; i386linux
&lt;br&gt;&lt;br&gt;Earlier there were no dot but a space between the version string and the 
&lt;br&gt;date string. Downgrading
&lt;br&gt;the target binutils to 2.15.94 was my first workaround and with them the 
&lt;br&gt;version info was added.
&lt;br&gt;Also the more uptodate binutils like 2.19.51 have this dot there so 
&lt;br&gt;either it should be fixed away
&lt;br&gt;in the binutils sources or the gcc-4.1.2/libstdc++-v3/configure* stuff 
&lt;br&gt;be fixed to accept the dot
&lt;br&gt;and interpret the binutils version right... The newer GCCs seem to 
&lt;br&gt;interpret this ok so looking at
&lt;br&gt;the diffs could tell the patch....
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/libstdc%2B%2B.so-without-version-information-tp26497424p26538499.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26537017</id>
	<title>Re: Can I find what #defines's the pre-processor makes?</title>
	<published>2009-11-26T17:44:46Z</published>
	<updated>2009-11-26T17:44:46Z</updated>
	<author>
		<name>Philipp Thomas-3</name>
	</author>
	<content type="html">On Thu, 26 Nov 2009 17:19:47 +0000, you wrote:
&lt;br&gt;&lt;br&gt;&amp;gt;I know if I use gcc, it will define __GNUC__, and no doubt many other things 
&lt;br&gt;&amp;gt;too. Does anyone know how to get a list of them all? Is there a command I can 
&lt;br&gt;&amp;gt;execute which will list them? 
&lt;br&gt;&lt;br&gt;I use 'gcc -dM -E -xc /dev/null' to get all predefines.
&lt;br&gt;&lt;br&gt;Philipp
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Can-I-find-what--defines%27s-the-pre-processor-makes--tp26532566p26537017.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26536999</id>
	<title>Re: libstdc++.so without version information</title>
	<published>2009-11-26T17:41:43Z</published>
	<updated>2009-11-26T17:41:43Z</updated>
	<author>
		<name>Philipp Thomas-3</name>
	</author>
	<content type="html">On Wed, 25 Nov 2009 11:40:25 +0100, you wrote:
&lt;br&gt;&lt;br&gt;&amp;gt;root:# objdump -p libstdc++.so.6.0.8
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;libstdc++.so.6.0.8: &amp;nbsp; &amp;nbsp; file format elf32-i386
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;ldconfig did find the library, but could not extract the version info
&lt;br&gt;&amp;gt;(regarding CXXABI and GLIBCXX), since it's obviously not there. And
&lt;br&gt;&amp;gt;I don't know why.
&lt;br&gt;&lt;br&gt;If there is no version info, you'll have to examine the build log of
&lt;br&gt;your gcc (or start a new build and log that) and search for the
&lt;br&gt;line(s) where libstdc+ is itself linked. I haven't looked at gcc
&lt;br&gt;makefiles for a long time but ld should be passed a version script
&lt;br&gt;that contains the versioning info ld will then put into the library.
&lt;br&gt;&lt;br&gt;Philipp
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/libstdc%2B%2B.so-without-version-information-tp26497424p26536999.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26534850</id>
	<title>Re: Can I find what #defines's the pre-processor makes?</title>
	<published>2009-11-26T13:02:41Z</published>
	<updated>2009-11-26T13:02:41Z</updated>
	<author>
		<name>phorgan1</name>
	</author>
	<content type="html">Andrew Haley wrote:
&lt;br&gt;&amp;gt; gcc -save-temps -Wp,-dD
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Look in the .i file
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;On unix like machines,
&lt;br&gt;&lt;br&gt;echo | cpp -dD
&lt;br&gt;&lt;br&gt;generates the list on stdout (i.e. to your console, or xterm or 
&lt;br&gt;whatever) without having to have any files involved.
&lt;br&gt;&lt;br&gt;Patrick
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Can-I-find-what--defines%27s-the-pre-processor-makes--tp26532566p26534850.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26532612</id>
	<title>Re: Can I find what #defines's the pre-processor makes?</title>
	<published>2009-11-26T09:24:08Z</published>
	<updated>2009-11-26T09:24:08Z</updated>
	<author>
		<name>Andrew Haley</name>
	</author>
	<content type="html">Dr. David Kirkby wrote:
&lt;br&gt;&amp;gt; I know if I use gcc, it will define __GNUC__, and no doubt many other things 
&lt;br&gt;&amp;gt; too. Does anyone know how to get a list of them all? Is there a command I can 
&lt;br&gt;&amp;gt; execute which will list them?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'd rather a command, than a pointer to documentation, as I want to do this on a 
&lt;br&gt;&amp;gt; gcc-like complier from Sun, which has a gcc-front end, but uses Sun's superior 
&lt;br&gt;&amp;gt; back end, to generate faster code. I want to know what that defines, but since 
&lt;br&gt;&amp;gt; it acts like gcc, anything that works on gcc should work on that too.
&lt;br&gt;&lt;br&gt;gcc -save-temps -Wp,-dD
&lt;br&gt;&lt;br&gt;Look in the .i file
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Can-I-find-what--defines%27s-the-pre-processor-makes--tp26532566p26532612.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26532566</id>
	<title>Can I find what #defines's the pre-processor makes?</title>
	<published>2009-11-26T09:19:47Z</published>
	<updated>2009-11-26T09:19:47Z</updated>
	<author>
		<name>Dr. David Kirkby</name>
	</author>
	<content type="html">I know if I use gcc, it will define __GNUC__, and no doubt many other things 
&lt;br&gt;too. Does anyone know how to get a list of them all? Is there a command I can 
&lt;br&gt;execute which will list them?
&lt;br&gt;&lt;br&gt;I'd rather a command, than a pointer to documentation, as I want to do this on a 
&lt;br&gt;gcc-like complier from Sun, which has a gcc-front end, but uses Sun's superior 
&lt;br&gt;back end, to generate faster code. I want to know what that defines, but since 
&lt;br&gt;it acts like gcc, anything that works on gcc should work on that too.
&lt;br&gt;&lt;br&gt;Dave
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Can-I-find-what--defines%27s-the-pre-processor-makes--tp26532566p26532566.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26531190</id>
	<title>Re: cache optimization</title>
	<published>2009-11-26T07:38:19Z</published>
	<updated>2009-11-26T07:38:19Z</updated>
	<author>
		<name>Harald Servat-3</name>
	</author>
	<content type="html">-----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;Hash: SHA1
&lt;br&gt;&lt;br&gt;&lt;br&gt;Although there are other factors that may apply, you must consider that
&lt;br&gt;prefeteching the next element may be not enough for current
&lt;br&gt;microprocessors. First, I'm pretty sure that the processor would have
&lt;br&gt;the entire cache line once you bring some data. And second, nowadays,
&lt;br&gt;micoprocessors have hardware prefetching that do the same work for you
&lt;br&gt;without the need of adding extra instructions (remember, adding
&lt;br&gt;instructions make your code slower). Also consider that the
&lt;br&gt;microprocessor has other out-of-order special circuitry that may allow
&lt;br&gt;it to be working on &amp;quot;future&amp;quot; iterations while waiting on a cache miss.
&lt;br&gt;&lt;br&gt;So I think that you may prefetch data which is farther. With current gap
&lt;br&gt;between micro and memory speeds, I wouldn't be too impressed if you had
&lt;br&gt;to go at 7 or 8 cache lines away.
&lt;br&gt;&lt;br&gt;Just my .02 euro cents :)
&lt;br&gt;&lt;br&gt;En/na £ukasz ha escrit:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi I want to learn how to optimaze cache usage in gcc. I find builtin function __builtin_prefetch which should prefetch datas to cache .. so i use cannonical :) example of vector addition.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;gt; &amp;nbsp; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; a[i] = a[i] + b[i];
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; __builtin_prefetch (&amp;a[i+1], 1, 1);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; __builtin_prefetch (&amp;b[i+1], 0, 1);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; /* ... */
&lt;br&gt;&amp;gt; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; and compile it with gcc without special options .... but its slower than
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;gt; &amp;nbsp; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; a[i] = a[i] + b[i];
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; /* ... */
&lt;br&gt;&amp;gt; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; so maybe I should compile it with soem extra options to have advantage of cache prefatching ?(-fprefetch-loop-array doenst works )
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;-----BEGIN PGP SIGNATURE-----
&lt;br&gt;Version: GnuPG v2.0.9 (GNU/Linux)
&lt;br&gt;&lt;br&gt;iEYEARECAAYFAksOoOsACgkQwMPeuqUCg9yj9wCbBd7DxNBKk9uNzV5xz4r66He4
&lt;br&gt;r9gAnRncLhV0SYr6MgoUz7qG+hSL8S9b
&lt;br&gt;=t8mz
&lt;br&gt;-----END PGP SIGNATURE-----
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-optimization-tp26529275p26531190.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26531196</id>
	<title>Re: cache optimization</title>
	<published>2009-11-26T07:38:02Z</published>
	<updated>2009-11-26T07:38:02Z</updated>
	<author>
		<name>Tim Prince-4</name>
	</author>
	<content type="html">£ukasz wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi I want to learn how to optimaze cache usage in gcc. I find builtin function __builtin_prefetch which should prefetch datas to cache .. so i use cannonical :) example of vector addition.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;gt; &amp;nbsp; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; a[i] = a[i] + b[i];
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; __builtin_prefetch (&amp;a[i+1], 1, 1);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; __builtin_prefetch (&amp;b[i+1], 0, 1);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; /* ... */
&lt;br&gt;&amp;gt; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; and compile it with gcc without special options .... but its slower than
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;gt; &amp;nbsp; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; a[i] = a[i] + b[i];
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; /* ... */
&lt;br&gt;&amp;gt; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; so maybe I should compile it with soem extra options to have advantage of cache prefatching ?(-fprefetch-loop-array doenst works )
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;/div&gt;Under normal settings, on CPUs of the last 6 years or so, you are 
&lt;br&gt;prefetching what has already been prefetched by hardware prefetcher. &amp;nbsp;If 
&lt;br&gt;your search engine doesn't find you many success stories about the use 
&lt;br&gt;of this feature, that might be a clue that it involves some serious 
&lt;br&gt;investigation. You would look for slow spots in your code which don't 
&lt;br&gt;fall in the usual hardware supported prefetch patterns (linear access 
&lt;br&gt;with not too large a stride, or pairs of cache lines), and experiment 
&lt;br&gt;with fetching the data sufficiently far in advance for it to do some 
&lt;br&gt;good, without exceeding your cache capacity.
&lt;br&gt;I do see a &amp;quot;success story&amp;quot; about prefetching for a reversed loop. As the 
&lt;br&gt;author doesn't divulge the CPU in use, one suspects it might be 
&lt;br&gt;something like the old Athlon32 which supported hardware prefetch only 
&lt;br&gt;in the forward direction. Don't you like advice which assumes no one 
&lt;br&gt;will ever use a CPU different (e.g. more up to date) than the author's 
&lt;br&gt;favorite?
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-optimization-tp26529275p26531196.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26529275</id>
	<title>cache optimization</title>
	<published>2009-11-26T05:14:10Z</published>
	<updated>2009-11-26T05:14:10Z</updated>
	<author>
		<name>gazzel</name>
	</author>
	<content type="html">Hi I want to learn how to optimaze cache usage in gcc. I find builtin function __builtin_prefetch which should prefetch datas to cache .. so i use cannonical :) example of vector addition.
&lt;br&gt;&lt;br&gt;for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; a[i] = a[i] + b[i];
&lt;br&gt;&amp;nbsp; &amp;nbsp; __builtin_prefetch (&amp;a[i+1], 1, 1);
&lt;br&gt;&amp;nbsp; &amp;nbsp; __builtin_prefetch (&amp;b[i+1], 0, 1);
&lt;br&gt;&amp;nbsp; &amp;nbsp; /* ... */
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&lt;br&gt;and compile it with gcc without special options .... but its slower than
&lt;br&gt;&lt;br&gt;for (i = 0; i &amp;lt; n; i++)
&lt;br&gt;&amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; a[i] = a[i] + b[i];
&lt;br&gt;&amp;nbsp; &amp;nbsp; /* ... */
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&lt;br&gt;so maybe I should compile it with soem extra options to have advantage of cache prefatching ?(-fprefetch-loop-array doenst works )
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-optimization-tp26529275p26529275.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26524288</id>
	<title>Compiled with gcc -pg, but no gmon.out produced</title>
	<published>2009-11-25T20:41:18Z</published>
	<updated>2009-11-25T20:41:18Z</updated>
	<author>
		<name>Michael Sanders-6</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;I'm having some trouble trying to profile my code. I'm just testing it
&lt;br&gt;out with a simple hello world program:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ cat bar.c
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #include &amp;lt;stdio.h&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int main(void)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf(&amp;quot;Hello, world!\n&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt; However, when I compile and run it, no gmon.out is produced (as
&lt;br&gt;required by gprof):
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ gcc -o bar bar.c -pg &amp;&amp; ./bar &amp;&amp; ls ./gmon.out
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Hello, world!
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ls: ./gmon.out: No such file or directory
&lt;br&gt;&lt;br&gt;Is there anything obvious that I'm screwing up here? I'm running this
&lt;br&gt;on OS X 10.5.
&lt;br&gt;&lt;br&gt;Thanks.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Compiled-with-gcc--pg%2C-but-no-gmon.out-produced-tp26524288p26524288.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26510609</id>
	<title>Re: libstdc++.so without version information</title>
	<published>2009-11-25T02:40:25Z</published>
	<updated>2009-11-25T02:40:25Z</updated>
	<author>
		<name>Christian Schaubschlaeger-3</name>
	</author>
	<content type="html">Philipp Thomas schrieb:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Tue, 24 Nov 2009 16:02:29 +0100, you wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;libdl.so.2 (GLIBC_2.0) =&amp;gt; /lib/libdl.so.2
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;libstdc++.so.6 (CXXABI_1.3) =&amp;gt; not found
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;libstdc++.so.6 (GLIBCXX_3.4) =&amp;gt; not found
&lt;br&gt;&amp;gt;&amp;gt; [snip]
&lt;br&gt;&amp;gt;&amp;gt; It seems that the libstdc++ does not contain the needed information:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You can't check with strings. The right way to check the version
&lt;br&gt;&amp;gt; information is by using &amp;nbsp;'objdump -p' on the library. When doing so,
&lt;br&gt;&amp;gt; you'll see something like
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Version definitions:
&lt;br&gt;&amp;gt; 1 0x01 0x025f4d66 libstdc++.so.6
&lt;br&gt;&amp;gt; 2 0x00 0x08922974 GLIBCXX_3.4
&lt;br&gt;&amp;gt; 3 0x00 0x02297f81 GLIBCXX_3.4.1
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GLIBCXX_3.4
&lt;br&gt;&amp;gt; 4 0x00 0x02297f82 GLIBCXX_3.4.2
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GLIBCXX_3.4.1
&lt;br&gt;&amp;gt; 5 0x00 0x02297f83 GLIBCXX_3.4.3
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GLIBCXX_3.4.2
&lt;/div&gt;&lt;br&gt;Thanks for your tips!
&lt;br&gt;With objdump I get:
&lt;br&gt;&lt;br&gt;root:# objdump -p libstdc++.so.6.0.8
&lt;br&gt;&lt;br&gt;libstdc++.so.6.0.8: &amp;nbsp; &amp;nbsp; file format elf32-i386
&lt;br&gt;&lt;br&gt;Program Header:
&lt;br&gt;&amp;nbsp; &amp;nbsp; LOAD off &amp;nbsp; &amp;nbsp;0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;filesz 0x000e1ee0 memsz 0x000e1ee0 flags r-x
&lt;br&gt;&amp;nbsp; &amp;nbsp; LOAD off &amp;nbsp; &amp;nbsp;0x000e28d8 vaddr 0x000e28d8 paddr 0x000e28d8 align 2**12
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;filesz 0x00004190 memsz 0x00009e8c flags rw-
&lt;br&gt;&amp;nbsp;DYNAMIC off &amp;nbsp; &amp;nbsp;0x000e597c vaddr 0x000e597c paddr 0x000e597c align 2**2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;filesz 0x000000e0 memsz 0x000000e0 flags rw-
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;TLS off &amp;nbsp; &amp;nbsp;0x000e28d8 vaddr 0x000e28d8 paddr 0x000e28d8 align 2**2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;filesz 0x00000000 memsz 0x00000008 flags r--
&lt;br&gt;EH_FRAME off &amp;nbsp; &amp;nbsp;0x000c4cb0 vaddr 0x000c4cb0 paddr 0x000c4cb0 align 2**2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;filesz 0x0000456c memsz 0x0000456c flags r--
&lt;br&gt;&amp;nbsp; &amp;nbsp;STACK off &amp;nbsp; &amp;nbsp;0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;filesz 0x00000000 memsz 0x00000000 flags rw-
&lt;br&gt;&amp;nbsp; &amp;nbsp;RELRO off &amp;nbsp; &amp;nbsp;0x000e28d8 vaddr 0x000e28d8 paddr 0x000e28d8 align 2**0
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;filesz 0x000030a4 memsz 0x0000308c flags r--
&lt;br&gt;&lt;br&gt;Dynamic Section:
&lt;br&gt;&amp;nbsp; NEEDED &amp;nbsp; &amp;nbsp; &amp;nbsp;libm.so.6
&lt;br&gt;&amp;nbsp; NEEDED &amp;nbsp; &amp;nbsp; &amp;nbsp;libgcc_s.so.1
&lt;br&gt;&amp;nbsp; NEEDED &amp;nbsp; &amp;nbsp; &amp;nbsp;libc.so.6
&lt;br&gt;&amp;nbsp; NEEDED &amp;nbsp; &amp;nbsp; &amp;nbsp;ld-linux.so.2
&lt;br&gt;&amp;nbsp; SONAME &amp;nbsp; &amp;nbsp; &amp;nbsp;libstdc++.so.6
&lt;br&gt;&amp;nbsp; INIT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0x446c0
&lt;br&gt;&amp;nbsp; FINI &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0xc0954
&lt;br&gt;&amp;nbsp; HASH &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0x114
&lt;br&gt;&amp;nbsp; STRTAB &amp;nbsp; &amp;nbsp; &amp;nbsp;0x135ac
&lt;br&gt;&amp;nbsp; SYMTAB &amp;nbsp; &amp;nbsp; &amp;nbsp;0x4b8c
&lt;br&gt;&amp;nbsp; STRSZ &amp;nbsp; &amp;nbsp; &amp;nbsp; 0x295d0
&lt;br&gt;&amp;nbsp; SYMENT &amp;nbsp; &amp;nbsp; &amp;nbsp;0x10
&lt;br&gt;&amp;nbsp; PLTGOT &amp;nbsp; &amp;nbsp; &amp;nbsp;0xe5ff4
&lt;br&gt;&amp;nbsp; PLTRELSZ &amp;nbsp; &amp;nbsp;0x11a8
&lt;br&gt;&amp;nbsp; PLTREL &amp;nbsp; &amp;nbsp; &amp;nbsp;0x11
&lt;br&gt;&amp;nbsp; JMPREL &amp;nbsp; &amp;nbsp; &amp;nbsp;0x43518
&lt;br&gt;&amp;nbsp; REL &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0x3e980
&lt;br&gt;&amp;nbsp; RELSZ &amp;nbsp; &amp;nbsp; &amp;nbsp; 0x4b98
&lt;br&gt;&amp;nbsp; RELENT &amp;nbsp; &amp;nbsp; &amp;nbsp;0x8
&lt;br&gt;&amp;nbsp; VERNEED &amp;nbsp; &amp;nbsp; 0x3e8c0
&lt;br&gt;&amp;nbsp; VERNEEDNUM &amp;nbsp;0x3
&lt;br&gt;&amp;nbsp; VERSYM &amp;nbsp; &amp;nbsp; &amp;nbsp;0x3cb7c
&lt;br&gt;&amp;nbsp; RELCOUNT &amp;nbsp; &amp;nbsp;0x108
&lt;br&gt;&lt;br&gt;Version References:
&lt;br&gt;&amp;nbsp; required from ld-linux.so.2:
&lt;br&gt;&amp;nbsp; &amp;nbsp; 0x0d696913 0x00 09 GLIBC_2.3
&lt;br&gt;&amp;nbsp; required from libgcc_s.so.1:
&lt;br&gt;&amp;nbsp; &amp;nbsp; 0x0d696910 0x00 10 GLIBC_2.0
&lt;br&gt;&amp;nbsp; &amp;nbsp; 0x0b792653 0x00 08 GCC_3.3
&lt;br&gt;&amp;nbsp; &amp;nbsp; 0x0b792650 0x00 05 GCC_3.0
&lt;br&gt;&amp;nbsp; required from libc.so.6:
&lt;br&gt;&amp;nbsp; &amp;nbsp; 0x0d696911 0x00 07 GLIBC_2.1
&lt;br&gt;&amp;nbsp; &amp;nbsp; 0x0d696913 0x00 06 GLIBC_2.3
&lt;br&gt;&amp;nbsp; &amp;nbsp; 0x09691f73 0x00 04 GLIBC_2.1.3
&lt;br&gt;&amp;nbsp; &amp;nbsp; 0x0d696910 0x00 03 GLIBC_2.0
&lt;br&gt;&amp;nbsp; &amp;nbsp; 0x0d696912 0x00 02 GLIBC_2.2
&lt;br&gt;&lt;br&gt;i.e. no CXXABI, no GLIBCXX!
&lt;br&gt;&lt;br&gt;&amp;gt; Looks likeWhat ldconfig is telling you is that it doesn't find the
&lt;br&gt;&amp;gt; library. Try calling ldconfig to get the dynamic linker to cache the
&lt;br&gt;&amp;gt; library and then again ldd.
&lt;br&gt;&lt;br&gt;ldconfig did find the library, but could not extract the version info
&lt;br&gt;(regarding CXXABI and GLIBCXX), since it's obviously not there. And
&lt;br&gt;I don't know why.
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;Christian
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/libstdc%2B%2B.so-without-version-information-tp26497424p26510609.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26510278</id>
	<title>Re: libstdc++.so without version information</title>
	<published>2009-11-25T02:13:27Z</published>
	<updated>2009-11-25T02:13:27Z</updated>
	<author>
		<name>Philipp Thomas-3</name>
	</author>
	<content type="html">On Tue, 24 Nov 2009 16:02:29 +0100, you wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;libdl.so.2 (GLIBC_2.0) =&amp;gt; /lib/libdl.so.2
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;libstdc++.so.6 (CXXABI_1.3) =&amp;gt; not found
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;libstdc++.so.6 (GLIBCXX_3.4) =&amp;gt; not found
&lt;br&gt;&amp;gt;[snip]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;It seems that the libstdc++ does not contain the needed information:
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;You can't check with strings. The right way to check the version
&lt;br&gt;information is by using &amp;nbsp;'objdump -p' on the library. When doing so,
&lt;br&gt;you'll see something like
&lt;br&gt;&lt;br&gt;Version definitions:
&lt;br&gt;1 0x01 0x025f4d66 libstdc++.so.6
&lt;br&gt;2 0x00 0x08922974 GLIBCXX_3.4
&lt;br&gt;3 0x00 0x02297f81 GLIBCXX_3.4.1
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GLIBCXX_3.4
&lt;br&gt;4 0x00 0x02297f82 GLIBCXX_3.4.2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GLIBCXX_3.4.1
&lt;br&gt;5 0x00 0x02297f83 GLIBCXX_3.4.3
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GLIBCXX_3.4.2
&lt;br&gt;&lt;br&gt;Looks likeWhat ldconfig is telling you is that it doesn't find the
&lt;br&gt;library. Try calling ldconfig to get the dynamic linker to cache the
&lt;br&gt;library and then again ldd.
&lt;br&gt;&lt;br&gt;&amp;gt;How can I build libstdc++ so that it contains version information?
&lt;br&gt;&lt;br&gt;I'm certain that is does contain the info when looking with the right
&lt;br&gt;tool :)
&lt;br&gt;&lt;br&gt;Philipp
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/libstdc%2B%2B.so-without-version-information-tp26497424p26510278.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26510225</id>
	<title>Missing warning about uninitialized variable</title>
	<published>2009-11-25T02:09:04Z</published>
	<updated>2009-11-25T02:09:04Z</updated>
	<author>
		<name>David Sveningsson-3</name>
	</author>
	<content type="html">Hi, I recently ran into an issue with an uninitialized pointer which I 
&lt;br&gt;expected g++ to warn about.
&lt;br&gt;&lt;br&gt;class Foo {
&lt;br&gt;public:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Foo* a(){ return this; }
&lt;br&gt;};
&lt;br&gt;&lt;br&gt;int main(int argc, const char*[] ){
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for ( int i = 0; i &amp;lt; 6; i++ ){
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Foo* foo = foo-&amp;gt;a();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;This code compiles without any warnings (with -Wall) with both g++-4.4.2 
&lt;br&gt;and g++-4.2.4. Removing the for-loop gives me a warning as expected:
&lt;br&gt;&lt;br&gt;foo.cpp: In function ‘int main(int, const char**)’:
&lt;br&gt;foo.cpp:8: warning: ‘foo’ is used uninitialized in this function
&lt;br&gt;&lt;br&gt;I know this case is a bit silly but it happened because of a typo and 
&lt;br&gt;went unnoticed for a while.
&lt;br&gt;&lt;br&gt;Is my reasoning flawed or should g++ emit a warning?
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Missing-warning-about-uninitialized-variable-tp26510225p26510225.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26509893</id>
	<title>Re: Error message unrecognized opcode 'addl' in gcc-4.1.0  powerpc-eabi</title>
	<published>2009-11-25T01:43:29Z</published>
	<updated>2009-11-25T01:43:29Z</updated>
	<author>
		<name>Philipp Thomas-3</name>
	</author>
	<content type="html">On Wed, 18 Nov 2009 22:14:23 -0800 (PST), you wrote:
&lt;br&gt;&lt;br&gt;&amp;gt;These instructions are inline asm from freebsd source with GNU C
&lt;br&gt;&amp;gt;extension (__GNUC__) conditional compilation flag. I could 
&lt;br&gt;&amp;gt;proceed by undefining the flag for that file.
&lt;br&gt;&lt;br&gt;The right way would be to conditionalize the code on an architecture
&lt;br&gt;specific definition like __i386__. IMO you should try to inform the
&lt;br&gt;authors/maintainers of that code to fix it.
&lt;br&gt;&lt;br&gt;Philipp
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Error-message-unrecognized-opcode-%27addl%27-in-gcc-4.1.0-powerpc-eabi-tp26321412p26509893.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26509543</id>
	<title>Re: template classes faster than derived classes?</title>
	<published>2009-11-25T01:15:02Z</published>
	<updated>2009-11-25T01:15:02Z</updated>
	<author>
		<name>Axel Freyn</name>
	</author>
	<content type="html">Hi Nav,
&lt;br&gt;On Tue, Nov 24, 2009 at 08:53:11PM +0000, Nava Whiteford wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &lt;a href=&quot;http://linuxjunk.blogspot.com/2009/11/are-templates-faster-than-subclasses.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://linuxjunk.blogspot.com/2009/11/are-templates-faster-than-subclasses.html&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; I didn't see the first version. &amp;nbsp;In the current version, the templated &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;gt; code is simple enough that the optimizer can figure out the whole thing &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;gt; and skip everything. &amp;nbsp;The virtual code is not simple enough, so the code &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;gt; actually executes.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Ah ok, so it's able to optimise my loop in to a single multiply here? &amp;nbsp;That's neat.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; So you still aren't measuring what you set out to measure.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I've constructed a slightly more complicated test:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://linuxjunk.blogspot.com/2009/11/templates-v-subclasses-v2.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://linuxjunk.blogspot.com/2009/11/templates-v-subclasses-v2.html&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; In this case the templated version doesn't seem to have the same huge
&lt;br&gt;&amp;gt; advantage. Templated 20.73s against 21.1s for the classed version. I would guess
&lt;br&gt;&amp;gt; real, but not huge.
&lt;/div&gt;&lt;br&gt;May be another test would be to use a very simple function - and in
&lt;br&gt;addition forbid gcc to inline or optimize away the function calls:
&lt;br&gt;If you define the function as:
&lt;br&gt;int get_i() __attribute__((noinline)){
&lt;br&gt;&amp;nbsp; asm(&amp;quot;&amp;quot;);
&lt;br&gt;&amp;nbsp; return i*i;
&lt;br&gt;}
&lt;br&gt;it will be neither inlined nor the calls can't be optimized away (see
&lt;br&gt;&lt;a href=&quot;http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html&lt;/a&gt;).
&lt;br&gt;Then, you really can make the functions as small as possible (e.g. doing
&lt;br&gt;nothing) and compare the time needed to call them.
&lt;br&gt;&lt;br&gt;Axel
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/template-classes-faster-than-derived-classes--tp26502122p26509543.html" />
</entry>

</feed>
