exception storage overhead

Erik Smith ersmith@ucsd.edu
Mon May 29 22:56:00 GMT 2000


GCC version: 2.95.2

Why does the use of exceptions cause a trivial 11K program to jump to 
119K.  What could possibly be involved in the exception overhead that would 
require 109K of code?



         struct Foo {
                 void run(int j) {if (j<0) throw 1;}
         };

         int main(void) {
                 try {
                         Foo foo;
                         for(int i=0;i<=10000000;++i) {
                                 for(int j=0;j<=10;++j) {
                                         foo.run(j);
                                 }
                         }
                 }
                 catch (...) {return 1;}
                 return 0;
         }




More information about the Gcc-bugs mailing list