X86_64 -O3 flag causing seg faults

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We are building a large application with gcc-3.2.3 and when we use the
-O3 flag with our g++ instance it causes the runtime app to seg fault.
If we use -O0 then it works just fine. This applies to code built on the
x86_64 platform. If it is built on an X86 platform and run on the x86_64
then it is fine.

Anyone have any ideas?

Here is a piece of code to replicate it:
/* 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;
}
/** END ***********************/

Use g++ -m64 -O3 testmain.cpp
Then run a.out



Lew Newby Jr.
Sr. Linux Architect
SACC Inc.
Office: (740)454-8778
Fax: (740)454-8778
Mobile: (740)819-1615
lnewby@xxxxxxxxxxx or gideon@xxxxxxxx


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux