public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/8231: iostream header position causes bad code generation
@ 2002-11-02 13:43 paolo
0 siblings, 0 replies; 4+ messages in thread
From: paolo @ 2002-11-02 13:43 UTC (permalink / raw)
To: brister, gcc-bugs, gcc-prs, ljrittle, nobody
Synopsis: iostream header position causes bad code generation
Responsible-Changed-From-To: unassigned->ljrittle
Responsible-Changed-By: paolo
Responsible-Changed-When: Sat Nov 2 13:43:29 2002
Responsible-Changed-Why:
Loren, could you please have a look at this PR, which, if
still an issue with current mainline and 3_2, seems
definitely target specific?
Thanks, Paolo.
State-Changed-From-To: feedback->analyzed
State-Changed-By: paolo
State-Changed-When: Sat Nov 2 13:43:29 2002
State-Changed-Why:
Of course my first tests on i686-pc-linux-gnu from
freebsd4.6 preprocessed source are completely meaningless
:-( Sorry.
Anyway, this is the source I have:
// ----------------------------------
//#include <iostream> // *1*
class A
{
public:
A(const char *addr);
std::ostream &print(std::ostream &ostr) const;
private:
long address;
};
//#include <iostream> // *2*
std::ostream &operator<<(std::ostream &ostr, const A &addr)
{
return addr.print(ostr);
}
//#include <iostream> // *3*
std::ostream &A::print(std::ostream &ostr) const
{
return ostr << "OK";
}
//#include <iostream> // *4*
A::A(const char *)
{
address = 0xa000001;
}
//#include <iostream> // *5*
int main(int argc, char **argv)
{
A a1("x");
std::cout << "result: " << a1 << std::endl;
}
// -------------------------------------
With current mainline and 3_2-branch on i686-pc-linux-gnu
only including in // *1* leads to a succesfull compilation.
In that case the run-time behaviour is Ok.
paolo:~/Gcc/PRs/v3/Analyzed> a.out
result: OK
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8231
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: libstdc++/8231: iostream header position causes bad code generation
@ 2002-11-04 14:32 ljrittle
0 siblings, 0 replies; 4+ messages in thread
From: ljrittle @ 2002-11-04 14:32 UTC (permalink / raw)
To: brister, gcc-bugs, gcc-prs, ljrittle
Synopsis: iostream header position causes bad code generation
State-Changed-From-To: analyzed->closed
State-Changed-By: ljrittle
State-Changed-When: Mon Nov 4 14:32:21 2002
State-Changed-Why:
Paolo,
if the include of <iostream> is not in position #1, then
#include <iosfwd>
must appear there, no?
It is not legal to move the include of <iostream> out of
position #1 in any other case. In any event, with your
example, it is not OK to move the include of <iostream>
past position #3. Doing so is lying to the compiler.
As TC++PL-SE says it, <iosfwd> is sufficient to refer
to all things declared in <iostream> but not to apply
operations to them.
Not a regression but rather a more agressive use of the properties of the standard (in case this worked with libstdc++-v2).
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8231
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: libstdc++/8231: iostream header position causes bad code generation
@ 2002-11-02 13:16 brister
0 siblings, 0 replies; 4+ messages in thread
From: brister @ 2002-11-02 13:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libstdc++/8231; it has been noted by GNATS.
From: brister@nominum.com
To: paolo@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: libstdc++/8231: iostream header position causes bad code generation
Date: Sat, 2 Nov 2002 22:06:20 +0100
I'm sorry, but I don't have the original any more. It was under rapid change
so I merged the files together and made it as simple as possible to show the
bug.
> Synopsis: iostream header position causes bad code generation
> State-Changed-From-To: open->feedback
> State-Changed-By: paolo
> State-Changed-When: Sat Nov 2 12:48:37 2002
> State-Changed-Why:
> I can reproduce the problem on i686-pc-linux-gnu from
> your preprocessed file.
> However, could you possibly provide also the plain source
> and describe the problem referring to specific line
> numbers of it? This would speed-up the processing of the PR.
> Thanks, Paolo.
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8231
--
James Brister brister@nominum.com
Nominum Inc.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: libstdc++/8231: iostream header position causes bad code generation
@ 2002-11-02 12:48 paolo
0 siblings, 0 replies; 4+ messages in thread
From: paolo @ 2002-11-02 12:48 UTC (permalink / raw)
To: brister, gcc-bugs, gcc-prs, nobody
Synopsis: iostream header position causes bad code generation
State-Changed-From-To: open->feedback
State-Changed-By: paolo
State-Changed-When: Sat Nov 2 12:48:37 2002
State-Changed-Why:
I can reproduce the problem on i686-pc-linux-gnu from
your preprocessed file.
However, could you possibly provide also the plain source
and describe the problem referring to specific line
numbers of it? This would speed-up the processing of the PR.
Thanks, Paolo.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8231
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-11-04 22:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-02 13:43 libstdc++/8231: iostream header position causes bad code generation paolo
-- strict thread matches above, loose matches on Subject: below --
2002-11-04 14:32 ljrittle
2002-11-02 13:16 brister
2002-11-02 12:48 paolo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).