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

[PATCH] ARM: Add missing is_reference to __cxa_type_match.

The ARM EHABI in section 8.4.2 defines __cxa_type_match to take 4
parameters. The prototype in gcc/config/arm/unwind-arm.c lists only 3
parameters. The "bool is_reference" parameter is missing, and should be
added. This patch adds the "bool is_reference" parameter to the

The ARM EHABI Section 9.2 defines the encoding for different descriptor
types, with "1,0" encoding for a "Catch descriptor". The "Catch
descriptor" landing pad word encodes "is_reference" as the highest bit
in the word. This patch extracts the "is_reference" value and passes it
to __cxa_type_match as needed by the standard. All other descriptor
types do not make use of "is_reference," and we set "is_reference" to
zero in those cases.

The patch gets us 1 step closer to being fully EABI compliant.

OK for mainline.

No regressions for arm-none-linux-gnueabi.

Carlos O'Donell
(650) 331-3385 x716


2006-12-01  Carlos O'Donell  <>

	* config/arm/unwind-arm.c: Adjust __cxa_type_match declaration.
	(__gnu_unwind_pr_common): Pass is_reference to __cxa_type_match.

Index: gcc/config/arm/unwind-arm.c
--- gcc/config/arm/unwind-arm.c	(revision 119410)
+++ gcc/config/arm/unwind-arm.c	(working copy)
@@ -41,6 +41,7 @@ void __attribute__((weak)) __cxa_call_un
 bool __attribute__((weak)) __cxa_begin_cleanup(_Unwind_Control_Block *ucbp);
 bool __attribute__((weak)) __cxa_type_match(_Unwind_Control_Block *ucbp,
 					    const type_info *rttip,
+					    bool is_reference,
 					    void **matched_object);
 _Unwind_Ptr __attribute__((weak))
@@ -847,6 +848,7 @@ __gnu_unwind_pr_common (_Unwind_State st
 		      /* Check for a barrier.  */
 		      _uw rtti;
+		      bool is_reference = (data[0] & uint32_highbit) != 0;
 		      void *matched;
 		      /* Check for no-throw areas.  */
@@ -860,6 +862,7 @@ __gnu_unwind_pr_common (_Unwind_State st
 			  /* Match a catch specification.  */
 			  rtti = _Unwind_decode_target2 ((_uw) &data[1]);
 			  if (!__cxa_type_match (ucbp, (type_info *) rtti,
+						 is_reference,
 			    matched = (void *)0;
@@ -907,7 +910,7 @@ __gnu_unwind_pr_common (_Unwind_State st
 			  matched = (void *)(ucbp + 1);
 			  rtti = _Unwind_decode_target2 ((_uw) &data[i + 1]);
-			  if (__cxa_type_match (ucbp, (type_info *) rtti,
+			  if (__cxa_type_match (ucbp, (type_info *) rtti, 0,

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