The following avoids adding fallthru edges to the control chain from
the post-dominator walk.
PR tree-optimization/106881
* gimple-predicate-analysis.cc (compute_control_dep_chain_pdom):
Add only non-fallthru edges and avoid the same set of edges
as the caller does.
* gcc.dg/uninit-pr106881.c: New testcase.
gcc.dg/unninit-pred-12.c and PR106754. */
if (single_pred_p (cd_bb))
{
- edge e2 = find_edge (prev_cd_bb, cd_bb);
- gcc_assert (e2);
- cur_cd_chain.safe_push (e2);
+ edge e2 = single_pred_edge (cd_bb);
+ gcc_assert (e2->src == prev_cd_bb);
+ /* But avoid adding fallthru or abnormal edges. */
+ if (!(e2->flags & (EDGE_FAKE | EDGE_ABNORMAL | EDGE_DFS_BACK))
+ && !single_succ_p (prev_cd_bb))
+ cur_cd_chain.safe_push (e2);
}
}
return found_cd_chain;
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fexceptions -Wuninitialized" } */
+
+void l_free (void *);
+char *l_settings_get_string ();
+void eap_append_secret ();
+inline void auto_free(void *a) {
+ void **p = a;
+ l_free(*p); /* { dg-warning "uninitialized" } */
+}
+void eap_gtc_check_settings() {
+ char *identity __attribute__((cleanup(auto_free)));
+ char password __attribute__((cleanup(auto_free)));
+ identity = l_settings_get_string();
+ eap_append_secret();
+}