re PR tree-optimization/56521 (Uninitialized value_id)
authorRichard Biener <rguenther@suse.de>
Tue, 5 Mar 2013 15:02:58 +0000 (15:02 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 5 Mar 2013 15:02:58 +0000 (15:02 +0000)
2013-03-05  Richard Biener  <rguenther@suse.de>

PR tree-optimization/56521
* tree-ssa-sccvn.c (set_value_id_for_result): Always initialize
value-id.

From-SVN: r196465

gcc/ChangeLog
gcc/tree-ssa-sccvn.c

index dbef6b3..f04cd57 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-05  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/56521
+       * tree-ssa-sccvn.c (set_value_id_for_result): Always initialize
+       value-id.
+
 2013-03-05  Steven Bosscher  <steven@gcc.gnu.org>
 
        PR c++/55135
index 202980c..c63aa2d 100644 (file)
@@ -3954,18 +3954,17 @@ free_scc_vn (void)
   XDELETE (optimistic_info);
 }
 
-/* Set *ID if we computed something useful in RESULT.  */
+/* Set *ID according to RESULT.  */
 
 static void
 set_value_id_for_result (tree result, unsigned int *id)
 {
-  if (result)
-    {
-      if (TREE_CODE (result) == SSA_NAME)
-       *id = VN_INFO (result)->value_id;
-      else if (is_gimple_min_invariant (result))
-       *id = get_or_alloc_constant_value_id (result);
-    }
+  if (result && TREE_CODE (result) == SSA_NAME)
+    *id = VN_INFO (result)->value_id;
+  else if (result && is_gimple_min_invariant (result))
+    *id = get_or_alloc_constant_value_id (result);
+  else
+    *id = get_next_value_id ();
 }
 
 /* Set the value ids in the valid hash tables.  */