On 12/06/2017 04:50 PM, Jeff Law wrote:

Richi's fix for 83202 fixed a few other bugs in the BZ database.  This
patch adds regression tests for the 3 I trivially found.

Committing to the trunk.

The test submitted in pr82286 relied on the ERROR macro being
defined to trigger the false positive (I tend to get tripped
by this style of tests).  It doesn't look to me like it has
changed in the regression test but the macro isn't defined.

Martin

diff --git a/gcc/testsuite/gcc.dg/pr82286.c b/gcc/testsuite/gcc.dg/pr82286.c
new file mode 100644
index 00000000000..13e22501d48
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr82286.c
@@ -0,0 +1,60 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -Warray-bounds" } */
+
+#include <stdio.h>
+#include <math.h>
+
+#define MAX_MATRIX_SIZE      (10)
+
...
+      sum = p_input_matrix->data[col][row] - sum;
+      if (row == col) {
+       if (sum >= 0.0) {
+#if ERROR
+         tmp.data[row][col] = sqrtf (sum);
+#else
+         tmp.data[row][col] = sum;
+#endif
+       }

Reply via email to