+2013-08-29 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/57287
+ * tree-ssa-copy.c (may_propagate_copy): Allow propagating
+ of default defs that appear in abnormal PHI nodes.
+
2013-08-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/57685
+2013-08-29 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/57287
+ * gcc.dg/pr57287-2.c: New testcase.
+
2013-08-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/57685
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+#include <setjmp.h>
+
+struct node
+{
+ struct node *next;
+ char *name;
+} *list;
+
+struct node *list;
+struct node *head (void);
+
+sigjmp_buf *bar (void);
+
+int baz (void)
+{
+ struct node *n;
+ int varseen = 0;
+
+ list = head ();
+ for (n = list; n; n = n->next)
+ {
+ if (!varseen)
+ varseen = 1;
+
+ sigjmp_buf *buf = bar (); /* { dg-bogus "may be used uninitialized" "" } */
+ __sigsetjmp (*buf, 1);
+ }
+
+ if (!varseen)
+ return 0;
+ return 1;
+}
/* If ORIG flows in from an abnormal edge, it cannot be propagated. */
if (TREE_CODE (orig) == SSA_NAME
- && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (orig))
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (orig)
+ /* If it is the default definition and an automatic variable then
+ we can though and it is important that we do to avoid
+ uninitialized regular copies. */
+ && !(SSA_NAME_IS_DEFAULT_DEF (orig)
+ && (SSA_NAME_VAR (orig) == NULL_TREE
+ || TREE_CODE (SSA_NAME_VAR (orig)) == VAR_DECL)))
return false;
/* If DEST is an SSA_NAME that flows from an abnormal edge, then it