]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/58377 (spurious "may be used uninitialized" warning with -Og)
authorRichard Biener <rguenther@suse.de>
Wed, 11 Sep 2013 12:20:07 +0000 (12:20 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 11 Sep 2013 12:20:07 +0000 (12:20 +0000)
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

gcc/ChangeLog
gcc/passes.def
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/uninit-pred-4.C [new file with mode: 0644]
gcc/tree-cfg.c

index e5e1702e954fff0b5052138d1215dba2ef1d2bbb..5e9b2079e375e02ff1568225ccd6ced80db59826 100644 (file)
@@ -1,3 +1,9 @@
+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>
 
        PR tree-optimization/58385
index 736a28b64dc92ca0fd9643d36242a4476f05a55d..635b4c464e8de49d14c8288cf737c26d3aa930ea 100644 (file)
@@ -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
         variable.  Using a representation like Gated Single Assignment
         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_dse);
       NEXT_PASS (pass_forwprop);
@@ -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
          need to adjust LIM to be more friendly towards preserving accurate
         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_uncprop);
       NEXT_PASS (pass_local_pure_const);
index c924967ed3be0185fe375c7b69b91324c8aeb1aa..49e28adb46bce84e9829a6e7982aad779837d9e5 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        PR tree-optimization/58385
diff --git a/gcc/testsuite/g++.dg/uninit-pred-4.C b/gcc/testsuite/g++.dg/uninit-pred-4.C
new file mode 100644 (file)
index 0000000..94ab13c
--- /dev/null
@@ -0,0 +1,16 @@
+/* { 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;
+}
index c74b988593369076c927d549aca85f85d84a796e..dfe10016be54e0063316296c9ff2568d03ad03bd 100644 (file)
@@ -7929,6 +7929,7 @@ public:
   /* opt_pass methods: */
   unsigned int execute () { return split_critical_edges (); }
 
+  opt_pass * clone () { return new pass_split_crit_edges (ctxt_); }
 }; // class pass_split_crit_edges
 
 } // anon namespace
This page took 0.09684 seconds and 5 git commands to generate.