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++/3705: optimisation bug



>Number:         3705
>Category:       c++
>Synopsis:       -freg-struct-return generates incorrect code with C++ streams
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 16 20:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Corrin Lakeland
>Release:        3.0
>Organization:
>Environment:
System: Linux freki.otago.ac.nz 2.4.2-2 #1 Sun Apr 8 18:47:21 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --prefix=/home/lakeland : (reconfigured) ./configure --prefix=/home/lakeland/gcc
>Description:
	Any C++ code using streams, including cin/cout/cerr, and compiled with
        the optimisation flag -freg-struct-return causes segfaults when run
>How-To-Repeat:
freki ~ % cat dummy.cc
include <iostream.h>
 
int main(void)
{
    cout << "Hello " << 3 << endl;
    return 0;
}
freki ~ % g++ -freg-struct-return dummy.cc
freki ~ % ./a.out
Hello Segmentation fault
freki ~ % g++ dummy.cc
freki ~ % ./a.out
Hello 3

I hope I filled this in right...
>Fix:
	Don't use -freg-struct-return
>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]