[patch] Pmode/ptr_mode fix for except.c
Eric Christopher
echristo@redhat.com
Wed Sep 18 17:22:00 GMT 2002
When Pmode/ptr_mode are different we need to do the expansion and extend
this way:
2002-09-17 Eric Christopher <echristo@redhat.com>
* except.c: Use ptr_mode in expansion. Handle case
where Pmode != ptr_mode.
OK for somewhere?
-eric
--
Yuppies wear socks.
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.229
diff -u -p -w -r1.229 except.c
--- except.c 25 Aug 2002 05:21:10 -0000 1.229
+++ except.c 19 Sep 2002 00:20:32 -0000
@@ -2991,7 +2991,16 @@ rtx
expand_builtin_extract_return_addr (addr_tree)
tree addr_tree;
{
- rtx addr = expand_expr (addr_tree, NULL_RTX, Pmode, 0);
+ rtx addr = expand_expr (addr_tree, NULL_RTX, ptr_mode, 0);
+
+ if (ptr_mode != Pmode)
+ {
+#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
More information about the Gcc-patches
mailing list