re PR middle-end/64764 (internal compiler error: in is_value_included_in, at tree...
authorRichard Biener <rguenther@suse.de>
Mon, 26 Jan 2015 14:50:03 +0000 (14:50 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 26 Jan 2015 14:50:03 +0000 (14:50 +0000)
2015-01-26  Richard Biener  <rguenther@suse.de>

PR middle-end/64764
* tree-ssa-uninit.c (is_pred_expr_subset_of): Handle
combining two BIT_AND_EXPR predicates.

* gcc.dg/uninit-19.c: New testcase.

From-SVN: r220111

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/uninit-19.c [new file with mode: 0644]
gcc/tree-ssa-uninit.c

index 72ad21c835e36a95c4eea5d78a31e025965d799a..a5676178d76bdcbaabb179bf6404cd75919fbcd0 100644 (file)
@@ -1,8 +1,14 @@
+2015-01-26  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/64764
+       * tree-ssa-uninit.c (is_pred_expr_subset_of): Handle
+       combining two BIT_AND_EXPR predicates.
+
 2015-01-26  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR bootstrap/64754
        * tree-ssa-structalias.c (new_var_info): Initialize ruid.
----
+
 2015-01-26  Terry Guo  <terry.guo@arm.com>
 
        * config/arm/arm.c (arm_file_start): Update the assignment of
index 92e97c3486655f19992002da6ec7ff95ff749462..9c526b7a4bce02410e27a2b1f4da4f25d9493213 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-26  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/64764
+       * gcc.dg/uninit-19.c: New testcase.
+
 2015-01-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * lib/target-supports.exp (check_effective_target_vect64): Add
diff --git a/gcc/testsuite/gcc.dg/uninit-19.c b/gcc/testsuite/gcc.dg/uninit-19.c
new file mode 100644 (file)
index 0000000..3113cab
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-do compile } */\r
+/* { dg-options "-O -Wuninitialized" } */\r
+\r
+int a, l, m;\r
+float *b;\r
+float c, d, e, g, h;\r
+unsigned char i, k;\r
+void\r
+fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4,\r
+     unsigned char *c2, float *p10)\r
+{\r
+  if (p1 & 8)\r
+    b[3] = p10[a];  /* { dg-warning "may be used uninitialized" } */\r
+}\r
+\r
+void\r
+fn2 ()\r
+{\r
+  float *n;\r
+  if (l & 6)\r
+    n = &c + m;\r
+  fn1 (l, &d, &e, &g, &i, &h, &k, n);\r
+}\r
index 25aae19f5667a5c95aa33ef27fb60ccc60460aed..d04c185cc82559a495beaf7e548d8549b9f4a7c2 100644 (file)
@@ -1377,7 +1377,8 @@ is_pred_expr_subset_of (pred_info expr1, pred_info expr2)
   if (expr2.invert)
     code2 = invert_tree_comparison (code2, false);
 
-  if (code1 == EQ_EXPR && code2 == BIT_AND_EXPR)
+  if ((code1 == EQ_EXPR || code1 == BIT_AND_EXPR)
+      && code2 == BIT_AND_EXPR)
     return wi::eq_p (expr1.pred_rhs,
                     wi::bit_and (expr1.pred_rhs, expr2.pred_rhs));