From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kenny Simpson To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: libstdc++/3036: pair constructor not updated per DR 265 Date: Sun, 03 Jun 2001 23:26:00 -0000 Message-id: <20010604062601.30235.qmail@sourceware.cygnus.com> X-SW-Source: 2001-06/msg00061.html List-Id: The following reply was made to PR libstdc++/3036; it has been noted by GNATS. From: Kenny Simpson To: Phil Edwards , kenny.simpson@gs.com Cc: gcc-gnats@gcc.gnu.org, theonetruekenny@yahoo.com Subject: Re: libstdc++/3036: pair constructor not updated per DR 265 Date: Sun, 3 Jun 2001 23:16:30 -0700 (PDT) --- Phil Edwards wrote: ... Does gcc DTRT as far as 178 goes? ... Well, with the help of the uber-spiffy online compiler, I ran the following test: (g++ -O3 -S: observe the output) >>> template struct Foo { Foo() : m() {} T m; }; // dummy function to prevent things from being // optimized-out template void bar(T const&); int main() { // test each fundamental type bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); bar(Foo().m); // test pointer types bar(Foo().m); bar(Foo().m); return 0; } <<< In each of the tests, gcc DTRT as far as zero initializing the data member 'm', though the stack space was poorly allocated (each temp got it's own slot even though the lifetimes are disjoint). -Kenny __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/