aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-uninit.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-04-26 15:14:55 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2013-04-26 15:14:55 +0200
commite7d764f367fdd7b0e9c96ae8c5d8503dbc90c05e (patch)
tree166638c2234eb83d2a4b427d3c801fe8c44a5067 /gcc/tree-ssa-uninit.c
parent41e106896a657b1a5276559f243c9cfe39c67f83 (diff)
downloadgcc-e7d764f367fdd7b0e9c96ae8c5d8503dbc90c05e.zip
gcc-e7d764f367fdd7b0e9c96ae8c5d8503dbc90c05e.tar.gz
gcc-e7d764f367fdd7b0e9c96ae8c5d8503dbc90c05e.tar.bz2
re PR go/57045 (Build failure in libgo/runtime/proc.c: error: ‘({anonymous})’ may be used uninitialized in this function)
PR go/57045 * tree-ssa-uninit.c (compute_uninit_opnds_pos): In functions with nonlocal goto receivers or returns twice calls, ignore unininitialized values from abnormal edges to nl goto receiver or returns twice call. * gcc.dg/setjmp-5.c: New test. From-SVN: r198340
Diffstat (limited to 'gcc/tree-ssa-uninit.c')
-rw-r--r--gcc/tree-ssa-uninit.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c
index e8f3ff7..2cb22b7 100644
--- a/gcc/tree-ssa-uninit.c
+++ b/gcc/tree-ssa-uninit.c
@@ -151,7 +151,21 @@ compute_uninit_opnds_pos (gimple phi)
if (TREE_CODE (op) == SSA_NAME
&& ssa_undefined_value_p (op)
&& !can_skip_redundant_opnd (op, phi))
- MASK_SET_BIT (uninit_opnds, i);
+ {
+ /* Ignore SSA_NAMEs on abnormal edges to setjmp
+ or nonlocal goto receiver. */
+ if (cfun->has_nonlocal_label || cfun->calls_setjmp)
+ {
+ edge e = gimple_phi_arg_edge (phi, i);
+ if (e->flags & EDGE_ABNORMAL)
+ {
+ gimple last = last_stmt (e->src);
+ if (last && stmt_can_make_abnormal_goto (last))
+ continue;
+ }
+ }
+ MASK_SET_BIT (uninit_opnds, i);
+ }
}
return uninit_opnds;
}