Bug 116068

Summary: c++ code core dumps w/ -O flag on x86_64, works in gcc 3.3.2
Product: Red Hat Enterprise Linux 3 Reporter: Lenny <bugzilla>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-05-12 03:40:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lenny 2004-02-18 00:13:19 UTC
Description of problem:

The following code snippit fails when compiled w/ optimization 
enabled on gcc 3.2.3-24.  It works when you don't compile w/ -O.  It 
also works with gcc 3.3.2.

Version-Release number of selected component (if applicable):

gcc-3.2.3-24 (x86_64)

How reproducible:

Always

Steps to Reproduce:

$ /usr/bin/g++ -m64 -O3 test.cpp 
$ ./a.out 
Testing 1...
Testing 1 OK
Testing 2...
Segmentation fault (core dumped)

Source for test.cpp:

#include <iostream>
using namespace std;

void test1(...) {
}
void test2(int i, ...) {
}

int main(int, char **)
{
     cout << "Testing 1..." << endl;
     test1(1, 1.2);
     cout << "Testing 1 OK" << endl;

     cout << "Testing 2..." << endl;
     test2(1, 1.2);
     cout << "Testing 2 OK" << endl;

     return 1;
}

  
Actual results:


Expected results:


Additional info:

Comment 2 John Flanagan 2004-05-12 03:40:21 UTC
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-142.html