Commit 5c2961cf by Richard Biener Committed by Richard Biener

re PR c++/58377 (spurious "may be used uninitialized" warning with -Og)

2013-09-11  Richard Biener  <rguenther@suse.de>

	PR middle-end/58377
	* passes.def: Split critical edges before late uninit warning passes.
	* tree-cfg.c (pass_split_crit_edges): Implement clone method.

	* g++.dg/uninit-pred-4.C: New testcase.

From-SVN: r202496
parent 427e6a14
2013-09-11 Richard Biener <rguenther@suse.de>
PR middle-end/58377
* passes.def: Split critical edges before late uninit warning passes.
* tree-cfg.c (pass_split_crit_edges): Implement clone method.
2013-09-11 Jakub Jelinek <jakub@redhat.com> 2013-09-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/58385 PR tree-optimization/58385
......
...@@ -249,6 +249,9 @@ along with GCC; see the file COPYING3. If not see ...@@ -249,6 +249,9 @@ along with GCC; see the file COPYING3. If not see
account for the predicates protecting the set and the use of each account for the predicates protecting the set and the use of each
variable. Using a representation like Gated Single Assignment variable. Using a representation like Gated Single Assignment
may help. */ may help. */
/* Split critical edges before late uninit warning to reduce the
number of false positives from it. */
NEXT_PASS (pass_split_crit_edges);
NEXT_PASS (pass_late_warn_uninitialized); NEXT_PASS (pass_late_warn_uninitialized);
NEXT_PASS (pass_dse); NEXT_PASS (pass_dse);
NEXT_PASS (pass_forwprop); NEXT_PASS (pass_forwprop);
...@@ -282,6 +285,9 @@ along with GCC; see the file COPYING3. If not see ...@@ -282,6 +285,9 @@ along with GCC; see the file COPYING3. If not see
/* ??? We do want some kind of loop invariant motion, but we possibly /* ??? We do want some kind of loop invariant motion, but we possibly
need to adjust LIM to be more friendly towards preserving accurate need to adjust LIM to be more friendly towards preserving accurate
debug information here. */ debug information here. */
/* Split critical edges before late uninit warning to reduce the
number of false positives from it. */
NEXT_PASS (pass_split_crit_edges);
NEXT_PASS (pass_late_warn_uninitialized); NEXT_PASS (pass_late_warn_uninitialized);
NEXT_PASS (pass_uncprop); NEXT_PASS (pass_uncprop);
NEXT_PASS (pass_local_pure_const); NEXT_PASS (pass_local_pure_const);
......
2013-09-11 Richard Biener <rguenther@suse.de>
PR middle-end/58377
* g++.dg/uninit-pred-4.C: New testcase.
2013-09-11 Jakub Jelinek <jakub@redhat.com> 2013-09-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/58385 PR tree-optimization/58385
......
/* { dg-do compile } */
/* { dg-options "-Wuninitialized -Og" } */
int pop ();
int pop_first_bucket;
int my_pop ()
{
int out; // { dg-bogus "uninitialized" "uninitialized variable warning" }
while (pop_first_bucket)
if (pop_first_bucket && (out = pop()))
return out;
return 0;
}
...@@ -7929,6 +7929,7 @@ public: ...@@ -7929,6 +7929,7 @@ public:
/* opt_pass methods: */ /* opt_pass methods: */
unsigned int execute () { return split_critical_edges (); } unsigned int execute () { return split_critical_edges (); }
opt_pass * clone () { return new pass_split_crit_edges (ctxt_); }
}; // class pass_split_crit_edges }; // class pass_split_crit_edges
} // anon namespace } // anon namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment