summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-24 12:44:58 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-24 12:44:58 +0000
commit5f4dd0d0e39b32015ae64d665ad17c78c1a0ca84 (patch)
tree360e0745d4435c019b457ee1faff9ba27ed5d218 /gcc
parentbb79f009f95d683b130f34867ed9a7d59ad967f3 (diff)
downloadgcc-5f4dd0d0e39b32015ae64d665ad17c78c1a0ca84.tar.gz
2013-05-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/57287 * tree-ssa-uninit.c (compute_uninit_opnds_pos): Disregard all SSA names that occur in abnormal PHIs. * gcc.dg/pr57287.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199289 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr57287.c24
-rw-r--r--gcc/tree-ssa-uninit.c13
4 files changed, 39 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 01f77cbfa87..dd36f0b33df 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2013-05-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/57287
+ * tree-ssa-uninit.c (compute_uninit_opnds_pos): Disregard
+ all SSA names that occur in abnormal PHIs.
+
2013-05-24 Alexander Ivchenko <alexander.ivchenko@intel.com>
PR tree-ssa/57385
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index bb3b4997ae4..cd0842df50c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/57287
+ * gcc.dg/pr57287.c: New testcase.
+
2013-05-24 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/26572
diff --git a/gcc/testsuite/gcc.dg/pr57287.c b/gcc/testsuite/gcc.dg/pr57287.c
new file mode 100644
index 00000000000..72225b11931
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr57287.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+#include <setjmp.h>
+
+jmp_buf buf;
+
+void foo (int);
+void bar (int) __attribute__((leaf));
+
+void enumerate_locals (int indent)
+{
+ foo (0);
+ while (indent--)
+ {
+ int local_indent = 8 + (8 * indent);
+ if (local_indent != 8)
+ {
+ setjmp (buf);
+ bar (local_indent); /* { dg-bogus "may be used uninitialized" "" } */
+ }
+ }
+ foo (1);
+}
diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c
index aa01c51658f..9a726f115a9 100644
--- a/gcc/tree-ssa-uninit.c
+++ b/gcc/tree-ssa-uninit.c
@@ -165,17 +165,12 @@ compute_uninit_opnds_pos (gimple phi)
&& uninit_undefined_value_p (op)
&& !can_skip_redundant_opnd (op, phi))
{
- /* 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;
- }
+ /* Ignore SSA_NAMEs that appear on abnormal edges
+ somewhere. */
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (op))
+ continue;
}
MASK_SET_BIT (uninit_opnds, i);
}