+2012-08-15 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR tree-optimization/54240
+ * tree-ssa-phiopt.c (hoist_adjacent_loads): Correct test for
+ existence of conditional move with given mode.
+
2012-08-15 Richard Guenther <rguenther@suse.de>
* double-int.h (double_int::from_unsigned): Rename to ...
+2012-08-15 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR tree-optimization/54240
+ * gcc.target/powerpc/pr54240.c: New test.
+ * gcc.target/mips/pr54240.c: Likewise.
+
2012-08-14 Oleg Endo <olegendo@gcc.gnu.org>
PR target/52933
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-phiopt-details isa>=4" } */
+
+typedef struct s {
+ int v;
+ int b;
+ struct s *l;
+ struct s *r;
+} S;
+
+
+int foo(S *s)
+{
+ S *this;
+ S *next;
+
+ this = s;
+ if (this->b)
+ next = this->l;
+ else
+ next = this->r;
+
+ return next->v;
+}
+
+/* { dg-final { scan-tree-dump "Hoisting adjacent loads" "phiopt1" } } */
+/* { dg-final { cleanup-tree-dump "phiopt1" } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -misel -fdump-tree-phiopt-details" } */
+
+typedef struct s {
+ int v;
+ int b;
+ struct s *l;
+ struct s *r;
+} S;
+
+
+int foo(S *s)
+{
+ S *this;
+ S *next;
+
+ this = s;
+ if (this->b)
+ next = this->l;
+ else
+ next = this->r;
+
+ return next->v;
+}
+
+/* { dg-final { scan-tree-dump "Hoisting adjacent loads" "phiopt1" } } */
+/* { dg-final { cleanup-tree-dump "phiopt1" } } */
/* Check the mode of the arguments to be sure a conditional move
can be generated for it. */
- if (!optab_handler (cmov_optab, TYPE_MODE (TREE_TYPE (arg1))))
+ if (optab_handler (movcc_optab, TYPE_MODE (TREE_TYPE (arg1)))
+ == CODE_FOR_nothing)
continue;
/* Both statements must be assignments whose RHS is a COMPONENT_REF. */