This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/1029: ICE at -O3 in overloaded operator



>Number:         1029
>Category:       c++
>Synopsis:       ICE at -O3 in overloaded operator
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 10 06:16:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Peter Bienstman
>Release:        gcc version 2.97 20001128 (experimental)
>Organization:
>Environment:
pbienst@castor:~/tmp > g++ -v
Reading specs from
/home/pbienst/gcc_Exp/bin/../lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc/configure --prefix=/home/pbienst/gcc_Exp/
--enable-languages=f77,c++
gcc version 2.97 20001128 (experimental)
>Description:
Compiling the following code gives an ICE at -O3:

struct A {};

struct B
{
    B(A&);
};

struct C
{
    void f(const B&);
    void g(const B&);
};

void C::g(const B& b)
{
   A* a;
   f(B(*a));
}
 
B::B(A& a) {}
 
void operator+(const B& b1, const B& b2)
{
  C c;
  A* a;
  c.f(B(*a));
}


pbienst@castor:~/tmp > g++ -O3 -c bug.cpp
bug.cpp: In function `void operator+(const B&, const B&)':
bug.cpp:26: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]