Patchwork [VMS/committed] : Do not use long in vms-unwind.h

login
register
mail settings
Submitter Tristan Gingold
Date March 16, 2012, 10:58 a.m.
Message ID <D450FDB8-4407-4FD1-B4B7-399360C6A69D@adacore.com>
Download mbox | patch
Permalink /patch/147184/
State New
Headers show

Comments

Tristan Gingold - March 16, 2012, 10:58 a.m.
Hi,

use of 'long' in vms-unwind.h for registers isn't correct as 'long' should be a 32 bit type on vms.
Let replace it with unw_reg, now defined as unsigned __int64.

Manually tested on ia64-hp-openvms.

Committed on trunk.

Tristan.

libgcc/
2012-03-16  Tristan Gingold  <gingold@adacore.com>

	* config/ia64/vms-unwind.h: Remove ulong (and replace
	it by unw_reg where used).  Define unw_reg with __int64.

Patch

Index: libgcc/config/ia64/vms-unwind.h
===================================================================
--- libgcc/config/ia64/vms-unwind.h	(revision 185454)
+++ libgcc/config/ia64/vms-unwind.h	(working copy)
@@ -49,9 +49,8 @@ 
 extern int LIB$I64_GET_CURR_INVO_CONTEXT (INVO_CONTEXT_BLK *);
 extern int LIB$I64_GET_PREV_INVO_CONTEXT (INVO_CONTEXT_BLK *);
 
-typedef unsigned long ulong;
 typedef unsigned int uint;
-typedef unsigned long uw_reg;
+typedef unsigned __int64 uw_reg;
 typedef uw_reg * uw_loc;
 
 typedef char fp_reg[16];
@@ -179,8 +178,8 @@ 
 
   if (eh_debug)
     printf ("User frame, "
-	    "chfmech @ 0x%lx, chfsig64 @ 0x%lx, intstk @ 0x%lx\n",
-	    (ulong)chfmech, (ulong)chfsig64, (ulong)intstk);
+	    "chfmech @ 0x%p, chfsig64 @ 0x%p, intstk @ 0x%p\n",
+	    chfmech, chfsig64, intstk);
 
   /* Step 2 :
      ------------------------------------------------------------------------
@@ -239,10 +238,10 @@ 
      trick already) and how this would be handled.  Blind alpha tentative
      below for experimentation purposes in malfunctioning cases.  */
   {
-    ulong q_bsp      = (ulong) intstk->intstk$q_bsp;
-    ulong q_bspstore = (ulong) intstk->intstk$q_bspstore;
-    ulong q_bspbase  = (ulong) intstk->intstk$q_bspbase;
-    ulong ih_bspbase = (ulong) icb->libicb$ih_bspbase;
+    uw_reg q_bsp      = (uw_reg) intstk->intstk$q_bsp;
+    uw_reg q_bspstore = (uw_reg) intstk->intstk$q_bspstore;
+    uw_reg q_bspbase  = (uw_reg) intstk->intstk$q_bspbase;
+    uw_reg ih_bspbase = (uw_reg) icb->libicb$ih_bspbase;
     
     if (eh_debug)
       printf ("q_bspstore = 0x%lx, q_bsp = 0x%lx, q_bspbase = 0x%lx\n"
@@ -254,8 +253,8 @@ 
        nothing resulted in proper behavior.  */
     if (q_bspstore < q_bsp && ih_bspbase && try_bs_copy)
       {
-	ulong dirty_size = q_bsp - q_bspstore;
-	ulong q_rnat = (ulong) intstk->intstk$q_rnat;
+	uw_reg dirty_size = q_bsp - q_bspstore;
+	uw_reg q_rnat = (uw_reg) intstk->intstk$q_rnat;
 
 	if (eh_debug)
 	  printf ("Attempting an alternate backing store copy ...\n");