This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/13501] -fnew-ra incorrectly assigns variable to register
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Dec 2003 20:40:22 -0000
- Subject: [Bug optimization/13501] -fnew-ra incorrectly assigns variable to register
- References: <20031228201047.13501.jbemmel@zonnet.nl>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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