+2010-11-12 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-11-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/46107
+ * cfgloopmanip.c (loop_version): Set irred_flag back into entry->flags
+ if cfg_hook_duplicate_loop_to_header_edge failed.
+
2010-11-10 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/46419
/* Duplicate loop. */
if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, 1,
NULL, NULL, NULL, 0))
- return NULL;
+ {
+ entry->flags |= irred_flag;
+ return NULL;
+ }
/* After duplication entry edge now points to new loop head block.
Note down new head as second_head. */
/* If the operand is a memory input, it should be an lvalue. */
if (!allows_reg && allows_mem)
{
+ tree inputv = TREE_VALUE (link);
+ STRIP_NOPS (inputv);
+ if (TREE_CODE (inputv) == PREDECREMENT_EXPR
+ || TREE_CODE (inputv) == PREINCREMENT_EXPR
+ || TREE_CODE (inputv) == POSTDECREMENT_EXPR
+ || TREE_CODE (inputv) == POSTINCREMENT_EXPR)
+ TREE_VALUE (link) = error_mark_node;
tret = gimplify_expr (&TREE_VALUE (link), pre_p, post_p,
is_gimple_lvalue, fb_lvalue | fb_mayfail);
mark_addressable (TREE_VALUE (link));
+2010-11-12 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-11-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/46107
+ * gcc.c-torture/compile/pr46107.c: New test.
+
2010-11-10 Uros Bizjak <ubizjak@gmail.com>
PR target/46419
--- /dev/null
+/* PR tree-optimization/46107 */
+
+int foo (void) __attribute__ ((noreturn));
+
+void
+bar (int x, int *y, int z)
+{
+ static void *j[] = { &&l1, &&l2 };
+l1:
+ if (*y)
+ goto *j[z];
+ foo ();
+l2:
+ *y ^= (x & 1) ? -1 : 0;
+ goto *j[x];
+}