@@ -1,5 +1,11 @@
2011-02-14 H.J. Lu <hongjiu.lu@intel.com>
+ PR middle-end/47727
+ * explow.c (convert_memory_address_addr_space): Permute the
+ conversion and addition if one operand is a constant.
+
+2011-02-14 H.J. Lu <hongjiu.lu@intel.com>
+
PR middle-end/47725
* function.c (assign_parm_setup_reg): Copy the hard register
first before extending it.
@@ -383,18 +383,13 @@ convert_memory_address_addr_space (enum machine_mode to_mode ATTRIBUTE_UNUSED,
case PLUS:
case MULT:
- /* For addition we can safely permute the conversion and addition
- operation if one operand is a constant and converting the constant
- does not change it or if one operand is a constant and we are
- using a ptr_extend instruction (POINTERS_EXTEND_UNSIGNED < 0).
- We can always safely permute them if we are making the address
- narrower. */
+ /* For addition we safely permute the conversion and addition
+ operation if one operand is a constant since we can't generate
+ new instructions. We can always safely permute them if we are
+ making the address narrower. */
if (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode)
|| (GET_CODE (x) == PLUS
- && CONST_INT_P (XEXP (x, 1))
- && (XEXP (x, 1) == convert_memory_address_addr_space
- (to_mode, XEXP (x, 1), as)
- || POINTERS_EXTEND_UNSIGNED < 0)))
+ && CONST_INT_P (XEXP (x, 1))))
return gen_rtx_fmt_ee (GET_CODE (x), to_mode,
convert_memory_address_addr_space
(to_mode, XEXP (x, 0), as),
@@ -1,3 +1,8 @@
+2011-02-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/47727
+ * gcc.dg/pr47727.c: New.
+
2011-02-13 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/47725
new file mode 100644
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef void (*func_ptr) (void);
+static func_ptr __CTOR_END__[1] = { (func_ptr) 0 };
+static void __attribute__((used))
+__do_global_ctors_aux (void)
+{
+ func_ptr *p;
+ for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
+ (*p) ();
+}