re PR bootstrap/63995 (Bootstrap error with -mmpx -fcheck-pointer-bounds)
authorIlya Enkovich <ilya.enkovich@intel.com>
Wed, 26 Nov 2014 14:37:07 +0000 (14:37 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Wed, 26 Nov 2014 14:37:07 +0000 (14:37 +0000)
gcc/

PR bootstrap/63995
* tree-chkp-opt.c (chkp_reduce_bounds_lifetime): Ignore
debug statement when searching for a new position for
bounds load/creation statement.

gcc/testsuite/

PR bootstrap/63995
* gcc.target/i386/pr63995-2.c: New.

From-SVN: r218085

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr63995-2.c [new file with mode: 0644]
gcc/tree-chkp-opt.c

index 9bd964ec4459f1a301becc91d90249b39f3695ff..702e86a77e0a40ad80ad646b15ed123057891b8b 100644 (file)
@@ -1,3 +1,10 @@
+2014-11-26  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR bootstrap/63995
+       * tree-chkp-opt.c (chkp_reduce_bounds_lifetime): Ignore
+       debug statement when searching for a new position for
+       bounds load/creation statement.
+
 2014-11-26  Marek Polacek  <polacek@redhat.com>
 
        PR sanitizer/63788
index 03605d1178e547a1f1d489a352d041475c73aea8..19e7aa17c6a9d8a3970b23ec27179ac1d5267e4d 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-26  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR bootstrap/63995
+       * gcc.target/i386/pr63995-2.c: New.
+
 2014-11-26  Ilya Enkovich  <ilya.enkovich@intel.com>
 
        PR lto/64075
diff --git a/gcc/testsuite/gcc.target/i386/pr63995-2.c b/gcc/testsuite/gcc.target/i386/pr63995-2.c
new file mode 100644 (file)
index 0000000..7c22e62
--- /dev/null
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
+/* { dg-options "-O2 -g -fcheck-pointer-bounds -mmpx -fcompare-debug" } */
+
+struct ts
+{
+  int field;
+};
+
+extern void test1 ();
+extern void test2 (struct ts *);
+
+static void
+init (struct ts *c)
+{
+  c->field = -1;
+}
+
+struct ts
+test3 (const struct ts *other)
+{
+  struct ts r;
+  if (other->field != 0)
+    test1 ();
+  init (&r);
+  test2 (&r);
+  return r;
+}
index ff390d7bb3ddc0a9cc2d9660d502a09479519d04..92e0694f09b7f7c629d4881f4521e9c38bd8b0c4 100644 (file)
@@ -1175,6 +1175,9 @@ chkp_reduce_bounds_lifetime (void)
 
       FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, op)
        {
+         if (is_gimple_debug (use_stmt))
+           continue;
+
          if (dom_bb &&
              dominated_by_p (CDI_DOMINATORS,
                              dom_bb, gimple_bb (use_stmt)))