This is the mail archive of the gcc-patches@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]

[tree-ssa] PATCH to genericize_try_block


The handler of a try block is a statement if it's a real try block.  Fixes
a testcase from fche that breaks out of a handler.  Test in
g++.dg/eh/loop2.C.

2003-02-05  Jason Merrill  <jason@redhat.com>

	* cp-simplify.c (genericize_try_block): Do genericize catch blocks.

*** cp-simplify.c.~1~	2003-02-05 17:23:57.000000000 -0500
--- cp-simplify.c	2003-02-05 17:15:48.000000000 -0500
*************** genericize_try_block (stmt_p)
*** 80,86 ****
    tree cleanup = TRY_HANDLERS (*stmt_p);
  
    c_simplify_stmt (&body);
!   /* cleanup is an expression, so it doesn't need to be genericized.  */
  
    *stmt_p = build (TRY_CATCH_EXPR, void_type_node, body, cleanup);
  }
--- 80,90 ----
    tree cleanup = TRY_HANDLERS (*stmt_p);
  
    c_simplify_stmt (&body);
! 
!   if (CLEANUP_P (*stmt_p))
!     /* cleanup is an expression, so it doesn't need to be genericized.  */;
!   else
!     c_simplify_stmt (&cleanup);
  
    *stmt_p = build (TRY_CATCH_EXPR, void_type_node, body, cleanup);
  }

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