This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: BUG: g++ 3.x.x -fomit-frame-pointer: exception handling doesn't work


On Sat, Aug 07, 2004 at 05:05:36PM -0700, James E Wilson wrote:

> You failed to mention the target.  You mentioned %ebx in which we can 
> imply that the target is x86, but it could also be x86_64.  You failed 
> to mention the gcc version.  gcc 3.x.x isn't specific enough.  I 
> seriously doubt that you have tried every gcc version.  Also, you failed 
> to mention the exact options you are using, and the OS you are using.

Yes, you are right, I'm sorry.

GCC versions are 3.3.2 and 3.3.4.

The target is x86.

The OS is Linux.

The options are:

-pipe -O2 -fomit-frame-pointer -fno-strength-reduce -fno-align-functions -fno-align-loops -fno-align-jumps -mpreferred-stack-boundary=2 -mcpu=pentium -fno-ident -D__USE_STRING_INLINES

And GCC's itself were compiled with the same options.  It may be
interesting too - compiling this way, the GCC's operator new throws
exceptions, which can't be cathed by anyone.  The sample is:


#include <stdio.h>

main()
{
    try {
        char *p= new char[-1];
    }
    catch (...) {
        puts("catched");
    }
}


But, I'm repeating, the result is not depend on an options to compile
the example itself, but on the options used to compile GCC
(particulary libsups++?).

> I tried to reproduce this on the AMD64 SuSE 9.1 system on my desk.  The 
> installed compiler is gcc-3.3.3 (SuSE Linux).  It works with -O, -O 
> -fomit-frame-pointer, -m32 -O, and -m32 -O -fomit-frame-pointer.  I 
> tried it with the gcc-3.4.x branch on the same platform with the same 
> options, and it worked for all of them.
> 
> I tried this on an x86 system using RHL 9, where the system compiler is 
> 3.2.2 20030222 (Red Hat Linux 3.2.2-5).  It works with both -O and -O 
> -fomit-frame-pointer.

For the first example, the problem doesn't arise for the optimization
level before -O2.


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