OSDN Git Service

* alias.c (find_base_term, case ZERO_EXTEND, case SIGN_EXTEND):
[pf3gnuchains/gcc-fork.git] / gcc / unwind.inc
index ba31536..f00441e 100644 (file)
@@ -1,22 +1,22 @@
-/* Exception handling and frame unwind runtime interface routines.
+/* Exception handling and frame unwind runtime interface routines. -*- C -*-
    Copyright (C) 2001 Free Software Foundation, Inc.
 
-   This file is part of GNU CC.
+   This file is part of GCC.
 
-   GNU CC is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
    any later version.
 
-   GNU CC is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with GNU CC; see the file COPYING.  If not, write to
-   the Free Software Foundation, 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   along with GCC; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.  */
 
 /* This is derived from the C++ ABI for IA-64.  Where we diverge
    for cross-architecture compatibility are noted with "@@@".  
@@ -47,7 +47,7 @@ _Unwind_RaiseException_Phase2(struct _Unwind_Exception *exc,
                       ? _UA_HANDLER_FRAME : 0);
 
       if (code != _URC_NO_REASON)
-       /* Some error encountered.  Ususally the unwinder doesn't
+       /* Some error encountered.  Usually the unwinder doesn't
           diagnose these and merely crashes.  */
        return _URC_FATAL_PHASE2_ERROR;
 
@@ -135,21 +135,25 @@ static _Unwind_Reason_Code
 _Unwind_ForcedUnwind_Phase2(struct _Unwind_Exception *exc,
                            struct _Unwind_Context *context)
 {
-  _Unwind_Stop_Fn stop = (_Unwind_Stop_Fn) exc->private_1;
-  void *stop_argument = (void *) exc->private_2;
+  _Unwind_Stop_Fn stop = (_Unwind_Stop_Fn) (_Unwind_Ptr) exc->private_1;
+  void *stop_argument = (void *) (_Unwind_Ptr) exc->private_2;
   _Unwind_Reason_Code code, stop_code;
 
   while (1)
     {
       _Unwind_FrameState fs;
+      int action;
 
       code = uw_frame_state_for (context, &fs);
       if (code != _URC_NO_REASON && code != _URC_END_OF_STACK)
        return _URC_FATAL_PHASE2_ERROR;
 
       /* Unwind successful.  */
-      stop_code = (*stop) (1, _UA_FORCE_UNWIND | _UA_CLEANUP_PHASE,
-                          exc->exception_class, exc, context, stop_argument);
+      action = _UA_FORCE_UNWIND | _UA_CLEANUP_PHASE;
+      if (code == _URC_END_OF_STACK)
+       action |= _UA_END_OF_STACK;
+      stop_code = (*stop) (1, action, exc->exception_class, exc,
+                          context, stop_argument);
       if (stop_code != _URC_NO_REASON)
        return _URC_FATAL_PHASE2_ERROR;