+2011-11-18 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/50605
+ * gimple.c (is_gimple_ip_invariant_address): Also handle MEM_REFs
+ of IPA invariant decls.
+
2011-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* tree-outof-ssa.c (insert_back_edge_copies): Add call to
return false;
op = strip_invariant_refs (TREE_OPERAND (t, 0));
+ if (!op)
+ return false;
+
+ if (TREE_CODE (op) == MEM_REF)
+ {
+ const_tree op0 = TREE_OPERAND (op, 0);
+ return (TREE_CODE (op0) == ADDR_EXPR
+ && (CONSTANT_CLASS_P (TREE_OPERAND (op0, 0))
+ || decl_address_ip_invariant_p (TREE_OPERAND (op0, 0))));
+ }
- return op && (CONSTANT_CLASS_P (op) || decl_address_ip_invariant_p (op));
+ return CONSTANT_CLASS_P (op) || decl_address_ip_invariant_p (op);
}
/* Return true if T is a GIMPLE minimal invariant. It's a restricted
+2011-11-18 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/50605
+ * g++.dg/ipa/pr50605.C: New test.
+
2011-11-18 Dodji Seketeli <dodji@redhat.com>
PR c++/51191
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-early-inlining" } */
+
+class A
+{
+public:
+ int a;
+ void *stuff;
+};
+
+class B
+{
+public:
+ int b;
+ void *other_stuff;
+ A array[50];
+};
+
+extern B gb;
+
+int process_A (A *a)
+{
+ return a->a;
+}
+
+int process_A_complex (A *a)
+{
+ return process_A (a+3);
+}
+
+int process_B (B *b)
+{
+ return process_A_complex (&b->array[0]);
+}
+
+int foo (void)
+{
+ return process_B (&gb);
+}
+