]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/59919 (ICE in process_assert_insertions_for, at tree-vrp...
authorJeff Law <law@redhat.com>
Fri, 24 Jan 2014 20:51:22 +0000 (13:51 -0700)
committerJeff Law <law@gcc.gnu.org>
Fri, 24 Jan 2014 20:51:22 +0000 (13:51 -0700)
PR tree-optimization/59919
* tree-vrp.c (find_assert_locations_1): Do not register asserts
for non-returning calls.

PR tree-optimization/59919
* gcc.c-torture/compile/pr59919.c: New test.

From-SVN: r207061

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr59919.c [new file with mode: 0644]
gcc/tree-vrp.c

index baf3bd693545d5b2daf04dde25f1564767b1ac64..f49d6bb95ecfdfbfc88a4ae51996af527679e81d 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-24  Jeff Law  <law@redhat.com>
+
+       PR tree-optimization/59919
+       * tree-vrp.c (find_assert_locations_1): Do not register asserts
+       for non-returning calls.
+
 2014-01-24  James Greenhalgh  <james.greenhalgh@arm.com>
 
        * common/config/aarch64/aarch64-common.c
index 445815ee4ebcf50616c4270646004a63b7ca3634..8a44033f7de9df9372e2905d989e2a70f344b9fc 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-24  Jeff Law  <law@redhat.com>
+
+       PR tree-optimization/59919
+       * gcc.c-torture/compile/pr59919.c: New test.
+
 2014-01-24  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/57524
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr59919.c b/gcc/testsuite/gcc.c-torture/compile/pr59919.c
new file mode 100644 (file)
index 0000000..6809caa
--- /dev/null
@@ -0,0 +1,18 @@
+typedef int jmp_buf[10];
+struct S
+{
+  int i;
+  jmp_buf buf;
+};
+
+void setjmp (jmp_buf);
+void foo (int *);
+__attribute__ ((__noreturn__, __nonnull__)) void bar (struct S *);
+
+void
+baz (struct S *p)
+{
+  bar (p);
+  setjmp (p->buf);
+  foo (&p->i);
+}
index f6da19252c67d68f4e4473fba0946593b3e46010..7aa732ddbb990d8ec36d9098be489a9503d499c7 100644 (file)
@@ -4534,12 +4534,21 @@ infer_value_range (gimple stmt, tree op, enum tree_code *comp_code_p, tree *val_
   if (stmt_could_throw_p (stmt))
     return false;
 
-  /* If STMT is the last statement of a basic block with no
+  /* If STMT is the last statement of a basic block with no normal
      successors, there is no point inferring anything about any of its
      operands.  We would not be able to find a proper insertion point
      for the assertion, anyway.  */
-  if (stmt_ends_bb_p (stmt) && EDGE_COUNT (gimple_bb (stmt)->succs) == 0)
-    return false;
+  if (stmt_ends_bb_p (stmt))
+    {
+      edge_iterator ei;
+      edge e;
+
+      FOR_EACH_EDGE (e, ei, gimple_bb (stmt)->succs)
+       if (!(e->flags & EDGE_ABNORMAL))
+         break;
+      if (e == NULL)
+       return false;
+    }
 
   if (infer_nonnull_range (stmt, op, true, true))
     {
This page took 0.101055 seconds and 5 git commands to generate.