+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-03 Ian Lance Taylor <iant@google.com>
PR lto/46273
/* Loop manipulation code for GNU compiler.
- Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009 Free Software
- Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
This file is part of GCC.
/* 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. */
2010-11-03 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/46107
+ * gcc.c-torture/compile/pr46107.c: New test.
+
PR debug/46252
* gcc.dg/pr46252.c: New test.
--- /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];
+}