[PATCH] Fix IA-64 libgcc unwinder

Jakub Jelinek jakub@redhat.com
Sun Apr 6 19:40:00 GMT 2003


Hi!

g++.old-deja/g++.eh/terminate2.C testcase fails with very recent IA-64
glibc. The problem seems to be:
2003-03-27  David Mosberger  <davidm@hpl.hp.com>
        * sysdeps/ia64/elf/start.S (_start): Use ".save rp, r0" idiom
        to terminate call-chain right from the get-go.
glibc patch, because unwind-ia64.c is not expecting .save something, r0
and aborts on it.
The following patch fixes it, ok for 3.2/3.3/trunk?

2003-04-06  Jakub Jelinek  <jakub@redhat.com>

	* config/ia64/unwind-ia64.c (uw_update_reg_address): Handle
	.save XX, r0.

--- gcc/config/ia64/unwind-ia64.c.jj	2002-04-02 16:17:25.000000000 -0500
+++ gcc/config/ia64/unwind-ia64.c	2003-04-06 15:27:39.000000000 -0400
@@ -1763,6 +1763,11 @@ uw_update_reg_address (struct _Unwind_Co
 	addr = ia64_rse_skip_regs ((unsigned long *) context->bsp, rval - 32);
       else if (rval >= 2)
 	addr = context->ireg[rval - 2].loc;
+      else if (rval == 0)
+	{
+	  static const unsigned long dummy;
+	  addr = (void *) &dummy;
+	}
       else
 	abort ();
       break;
@@ -1814,6 +1819,11 @@ uw_update_reg_address (struct _Unwind_Co
 	    context->ireg[regno - UNW_REG_R2].nat
 	      = context->ireg[rval - 2].nat;
 	  }
+	else if (rval == 0)
+	  {
+	    context->ireg[regno - UNW_REG_R2].nat.type = UNW_NAT_NONE;
+	    context->ireg[regno - UNW_REG_R2].nat.off = 0;
+	  }
 	else
 	  abort ();
 	break;

	Jakub



More information about the Gcc-patches mailing list