http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47727
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> 2011-02-14 13:51:27
UTC ---
Does this patch make any senses?
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index ce4eab4..e7e7890 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1099,10 +1099,13 @@ simplify_unary_operation_1 (enum rtx_code code, enum
mac
hine_mode mode, rtx op)
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
/* As we do not know which address space the pointer is refering to,
we can do this only if the target does not support different pointer
- or address modes depending on the address space. */
+ or address modes depending on the address space. Since we will
+ generate new instructions, we must be currently emitting into a
+ sequence. */
if (target_default_pointer_address_modes_p ()
&& POINTERS_EXTEND_UNSIGNED > 0
&& mode == Pmode && GET_MODE (op) == ptr_mode
+ && in_sequence_p ()
&& (CONSTANT_P (op)
|| (GET_CODE (op) == SUBREG
&& REG_P (SUBREG_REG (op))