except.c (expand_builtin_extract_return_address): Handle case where Pmode != ptr_mode.
authorEric Christopher <echristo@gcc.gnu.org>
Thu, 26 Sep 2002 21:39:14 +0000 (21:39 +0000)
committerEric Christopher <echristo@gcc.gnu.org>
Thu, 26 Sep 2002 21:39:14 +0000 (21:39 +0000)
2002-09-24  Eric Christopher  <echristo@redhat.com>

        * except.c (expand_builtin_extract_return_address): Handle case
where Pmode != ptr_mode.

From-SVN: r57552

gcc/ChangeLog
gcc/except.c

index 74d76b050f4757a17869c2b076967900fa623007..7927cc7b606f4598bbee47693df80289bdb5f3de 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-24  Eric Christopher  <echristo@redhat.com>
+
+        * except.c (expand_builtin_extract_return_address): Handle case
+       where Pmode != ptr_mode.
+
 2002-09-26  Steve Ellcey  <sje@cup.hp.com>
 
        * config/ia64/hpux.h (ASM_OUTPUT_EXTERNAL_LIBCALL): New
@@ -17,7 +22,7 @@
 
 2002-09-26  Ulrich Weigand  <uweigand@de.ibm.com>
 
-       * expr.c (expand_expr) [MINUS_EXPR]: Convert A - const to 
+       * expr.c (expand_expr) [MINUS_EXPR]: Convert A - const to
        A + (-const) on RTX level, even for unsigned types.
 
 2002-09-26  Ulrich Weigand  <uweigand@de.ibm.com>
index 26a231b87dbfd9dd61e62135a45f72547f6d57bb..08c0aa27ab240a48a9d8d359df6fad96e40703e1 100644 (file)
@@ -2993,6 +2993,16 @@ expand_builtin_extract_return_addr (addr_tree)
 {
   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);