re PR middle-end/65595 (Linux kernel build failure: ICE: in as_a, at is-a.h:192)
authorJan Hubicka <hubicka@ucw.cz>
Fri, 27 Mar 2015 10:33:17 +0000 (11:33 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 27 Mar 2015 10:33:17 +0000 (10:33 +0000)
PR middle-end/65595
* cgraph.c (cgraph_update_edges_for_call_stmt_node): Only
do redirection if the call is not optimized out.

* gcc.c-torture/compile/pr65595.c: New testcase.

From-SVN: r221726

gcc/ChangeLog
gcc/cgraph.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr65595.c [new file with mode: 0644]

index 1f6644d5863599b2408794ffe6bf9dbe8ab3ff99..5cee0a5c9c6b9c236c60f4fc8b4e15a208b2fe7d 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-26  Jan Hubicka  <hubicka@ucw.cz>
+
+       PR middle-end/65595
+       * cgraph.c (cgraph_update_edges_for_call_stmt_node): Only
+       do redirection if the call is not optimized out.
+
 2015-03-27  Ilya Enkovich  <ilya.enkovich@intel.com>
 
        PR target/65495
index 0d2b826a5e7c9912a27571280b59739fa5bd6dd7..96f5f40b801eff4d47e2f9e49fa8584a119e965c 100644 (file)
@@ -1516,7 +1516,7 @@ cgraph_update_edges_for_call_stmt_node (cgraph_node *node,
       if (e)
        {
          /* Keep calls marked as dead dead.  */
-         if (e->callee
+         if (new_call && e->callee
              && DECL_BUILT_IN_CLASS (e->callee->decl) == BUILT_IN_NORMAL
              && DECL_FUNCTION_CODE (e->callee->decl) == BUILT_IN_UNREACHABLE)
            {
index 9cbe0f93570887efe1e88f5c529278e01ab22cd6..03c4be4bc383a8c94549127b56261878159ba44d 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-26  Jan Hubicka  <hubicka@ucw.cz>
+
+       PR middle-end/65595
+       * gcc.c-torture/compile/pr65595.c: New testcase.
+
 2015-03-27  Marek Polacek  <polacek@redhat.com>
 
        PR sanitizer/65583
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr65595.c b/gcc/testsuite/gcc.c-torture/compile/pr65595.c
new file mode 100644 (file)
index 0000000..0ab7161
--- /dev/null
@@ -0,0 +1,19 @@
+extern void *memcpy(void *, const void *, unsigned long);
+struct in6_addr {
+  struct {
+    int u6_addr32[4];
+  };
+};
+struct foo {
+  struct in6_addr daddr;
+  struct in6_addr saddr;
+} a;
+extern void ip6_route_output(struct foo, int);
+int b;
+static void find_route_ipv6(struct in6_addr *p1) {
+  if (p1)
+    memcpy(0, p1, sizeof(struct in6_addr));
+  ip6_route_output(a, b);
+}
+void cxgbi_ep_connect() { find_route_ipv6(0); }
+