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]
Other format: [Raw text]

[Bug optimization/13501] -fnew-ra incorrectly assigns variable to register


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-28 20:40 -------
Confirmed also on i686-unknown-openbsd3.1 which also uses setjmp/longjmp exception 
handling, it works currectly with dwarf-2 exception handling.
Here is the sources I used:
#include <cstdio>
#include <exception>
using namespace std;
static void throwerClobberingRegs( int i ) throw (exception)
{  
   if (i==100) throw exception();
}
static void caller() {
   register int i=0; // ends up in a register... It should not be, since 'throw'
                     // clobbers it. Without 'register', option '-O' will get
                     // the same result
   try {
      for (;;++i) {
         throwerClobberingRegs(i);
      }
   } catch (exception &e) {
      printf( "\nCaught exception e.msg=%x i=%d", &e, i );
   }
}
int main( int argc, char* argv[] )
{  
   caller();
   return 0;
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-12-28 20:40:21
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13501


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