3.0.1 EH failure on sparc-sun-solaris2.7

Jeff Sturm jsturm@one-point.com
Fri Aug 10 15:30:00 GMT 2001


The program below dumps core on SPARC when compiled at -O2.  The
cleanup code expects register %i1 to be preserved, however it is not,
suggesting the fault lies with the EH runtime.  (In fact I first observed
a similar failure in a Java program.)

Since this apparently isn't a code generation but I don't know how to fix
it.  A quick search didn't find a similar PR, though I'm not certain which
category to use.  It is a regression from 2.95.2.

Unfortunately this causes 3.0.1 to be useless to me on SPARC :(


#include <cstdio>

struct silly {
  int val;
  silly (int n) { val = n; fprintf (stderr, "enter: %d\n", val); }
  ~silly () { fprintf (stderr, "leave: %d\n", val); }
};

int main (int argc, char **) {
  try {
    silly s (argc);
    throw 1;
  } catch (int n) {}
  return 0;
}



More information about the Gcc-bugs mailing list