[Bug c++/53294] Optimize out some exception code

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed May 9 14:36:00 GMT 2012


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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-05-09
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-09 13:55:37 UTC ---
Certainly interesting.  We lower things too early into __cxa calls though
(I think) to make this work easily.

Consider cases like

struct X { int i; };

int foo (void)
{
  try {
    X x;
    x.i = 5;
    throw x;
  } catch (X& x) {
      return x.i;
  } catch (...) {
   return 0;
   }
}



More information about the Gcc-bugs mailing list