[patch] Pmode/ptr_mode fix for except.c

Eric Christopher echristo@redhat.com
Wed Sep 25 16:58:00 GMT 2002


> though you may have to be more clever than that for
> addresses that wind up being integer constants (and
> thus VOIDmode).

Hrm. This appears to work... my builds for mips and a linux bootstrap
worked. My irix box is down atm so I haven't tested a bootstrap on that.

-eric

-- 
Yuppies wear socks.

Index: gcc/except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.230
diff -u -p -w -r1.230 except.c
--- gcc/except.c	22 Sep 2002 14:09:31 -0000	1.230
+++ gcc/except.c	25 Sep 2002 04:27:12 -0000
@@ -2993,6 +2993,16 @@ expand_builtin_extract_return_addr (addr
 {
   rtx addr = expand_expr (addr_tree, NULL_RTX, Pmode, 0);
 
+  if (GET_MODE (addr) != Pmode
+      && GET_MODE (addr) != VOIDmode)
+    {
+#ifdef POINTERS_EXTEND_UNSIGNED
+      addr = convert_memory_address (Pmode, addr);
+#else
+      addr = convert_to_mode (Pmode, addr, 0);
+#endif
+    }
+
   /* First mask out any unwanted bits.  */
 #ifdef MASK_RETURN_ADDR
   expand_and (Pmode, addr, MASK_RETURN_ADDR, addr);



More information about the Gcc-patches mailing list