This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
ia64 eh, part 15
- To: gcc-patches at gcc dot gnu dot org
- Subject: ia64 eh, part 15
- From: Richard Henderson <rth at redhat dot com>
- Date: Tue, 27 Mar 2001 23:50:15 -0800
Small simplifications.
r~
* stmt.c (expand_return): Remove always true predicate.
(expand_decl_cleanup_no_eh): Remove dead code.
Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.188
diff -c -p -d -r1.188 stmt.c
*** stmt.c 2001/03/22 18:48:31 1.188
--- stmt.c 2001/03/28 07:47:28
*************** expand_return (retval)
*** 2922,2928 ****
rtx result_rtl;
register rtx val = 0;
tree retval_rhs;
- int cleanups;
/* If function wants no value, give it none. */
if (TREE_CODE (TREE_TYPE (TREE_TYPE (current_function_decl))) == VOID_TYPE)
--- 2922,2927 ----
*************** expand_return (retval)
*** 2933,2949 ****
return;
}
- /* Are any cleanups needed? E.g. C++ destructors to be run? */
- /* This is not sufficient. We also need to watch for cleanups of the
- expression we are about to expand. Unfortunately, we cannot know
- if it has cleanups until we expand it, and we want to change how we
- expand it depending upon if we need cleanups. We can't win. */
- #if 0
- cleanups = any_pending_cleanups (1);
- #else
- cleanups = 1;
- #endif
-
if (retval == error_mark_node)
{
/* Treat this like a return of no value from a function that
--- 2932,2937 ----
*************** expand_return (retval)
*** 2962,2970 ****
else
retval_rhs = NULL_TREE;
! /* Only use `last_insn' if there are cleanups which must be run. */
! if (cleanups || cleanup_label != 0)
! last_insn = get_last_insn ();
/* Distribute return down conditional expr if either of the sides
may involve tail recursion (see test below). This enhances the number
--- 2950,2956 ----
else
retval_rhs = NULL_TREE;
! last_insn = get_last_insn ();
/* Distribute return down conditional expr if either of the sides
may involve tail recursion (see test below). This enhances the number
*************** expand_return (retval)
*** 3108,3118 ****
expand_value_return (result_reg);
}
! else if (cleanups
! && retval_rhs != 0
! && !VOID_TYPE_P (TREE_TYPE (retval_rhs))
! && (GET_CODE (result_rtl) == REG
! || (GET_CODE (result_rtl) == PARALLEL)))
{
/* Calculate the return value into a temporary (usually a pseudo
reg). */
--- 3094,3103 ----
expand_value_return (result_reg);
}
! else if (retval_rhs != 0
! && !VOID_TYPE_P (TREE_TYPE (retval_rhs))
! && (GET_CODE (result_rtl) == REG
! || (GET_CODE (result_rtl) == PARALLEL)))
{
/* Calculate the return value into a temporary (usually a pseudo
reg). */
*************** expand_decl_cleanup (decl, cleanup)
*** 4121,4145 ****
}
return 1;
}
-
- /* Like expand_decl_cleanup, but suppress generating an exception handler
- to perform the cleanup. */
-
- #if 0
- int
- expand_decl_cleanup_no_eh (decl, cleanup)
- tree decl, cleanup;
- {
- int save_eh = using_eh_for_cleanups_p;
- int result;
-
- using_eh_for_cleanups_p = 0;
- result = expand_decl_cleanup (decl, cleanup);
- using_eh_for_cleanups_p = save_eh;
-
- return result;
- }
- #endif
/* Arrange for the top element of the dynamic cleanup chain to be
popped if we exit the current binding contour. DECL is the
--- 4106,4111 ----