This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/59267] gcc 4.8.2 optimizes code with side-effects away
- From: "troomps01 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 26 Nov 2013 03:54:15 +0000
- Subject: [Bug tree-optimization/59267] gcc 4.8.2 optimizes code with side-effects away
- Auto-submitted: auto-generated
- References: <bug-59267-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59267
--- Comment #3 from James <troomps01 at gmail dot com> ---
Sorry about having a second comment in a row, but I was playing a bit more with
this, and using a string stream as solely an output stream doesn't appear to
update the stream pointer after outputting the value (shouldn't this also
output a blank string for os?):
#include <iostream>
#include <sstream>
using namespace std;
int main(void)
{
stringstream os("");
double val = 3.14159;
os << val;
cout << "Value: " << val << ", out stream: " << os.str() << endl;
return 0;
}