re PR tree-optimization/48929 (ICE: in estimate_size_after_inlining, at ipa-inline...
authorJan Hubicka <jh@suse.cz>
Sat, 4 Jun 2011 14:24:20 +0000 (16:24 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 4 Jun 2011 14:24:20 +0000 (14:24 +0000)
PR tree-optimize/48929
* gcc.c-torture/compile/pr48929.c: New testcase.
* ipa-inline-analysis.c (remap_edge_predicates): Fix handling
of empty predicate.

From-SVN: r174638

gcc/ChangeLog
gcc/ipa-inline-analysis.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr48929.c [new file with mode: 0644]

index c7f031f4ade1479c43a14bbc832311b18a6bc371..3306765661fd0b3e1c64ceb5e80c7e3ace4e156c 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-04  Jan Hubicka  <jh@suse.cz>
+
+       PR tree-optimize/48929
+       * ipa-inline-analysis.c (remap_edge_predicates): Fix handling
+       of empty predicate.
+
 2011-06-04  Alexandre Oliva  <aoliva@redhat.com>
 
        PR debug/48333
index 4a65dd5be0f575d9048574da0c79eee72b2f2b26..45bfeb6f4717c90cac371f13f4379e3baff88571 100644 (file)
@@ -1949,6 +1949,8 @@ remap_edge_predicates (struct cgraph_node *node,
       if (!e->inline_failed)
        remap_edge_predicates (e->callee, info, callee_info, operand_map,
                               possible_truths, toplev_predicate);
+      else
+       edge_set_predicate (e, toplev_predicate);
     }
   for (e = node->indirect_calls; e; e = e->next_callee)
     {
@@ -1969,6 +1971,8 @@ remap_edge_predicates (struct cgraph_node *node,
              e->frequency = 0;
            }
        }
+      else
+       edge_set_predicate (e, toplev_predicate);
     }
 }
 
index 6dd2803c754dc11daf895717c483661a6233d113..05efca005b47a69c11df318dc885669c0c763a54 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-04  Jan Hubicka  <jh@suse.cz>
+
+       PR tree-optimize/48929
+       * gcc.c-torture/compile/pr48929.c: New testcase.
+
 2011-06-04  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.dg/guality/rotatetest.c (f5, f6): Fix up pastos.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr48929.c b/gcc/testsuite/gcc.c-torture/compile/pr48929.c
new file mode 100644 (file)
index 0000000..f085dc6
--- /dev/null
@@ -0,0 +1,32 @@
+/*{ dg-options "-O  -findirect-inlining" }*/
+void bar ();
+
+static void
+f4 (double di, double d, double *dd)
+{
+  if (d == 0 && di == 0)
+    *dd = 0;
+  bar ();
+}
+
+static inline void
+f3 (int i, double d)
+{
+  double di = i;
+  double dd;
+  f4 (di, d, &dd);
+}
+
+static inline void
+f2 (int i, double d)
+{
+  if (d < 0)
+    f3 (i, d);
+}
+
+void
+f1 ()
+{
+  f2 (0, 1);
+}
+