aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-03-27 11:33:17 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-03-27 10:33:17 +0000
commit88e7d85fba68f0f9f3d87f14899dbcb6018a2844 (patch)
treec1ce668914cf00b1275c64a65327a0726e2009a2
parent79d64904522c8ba0b1f14f54fa2db8f2a38a441f (diff)
downloadgcc-88e7d85fba68f0f9f3d87f14899dbcb6018a2844.zip
gcc-88e7d85fba68f0f9f3d87f14899dbcb6018a2844.tar.gz
gcc-88e7d85fba68f0f9f3d87f14899dbcb6018a2844.tar.bz2
re PR middle-end/65595 (Linux kernel build failure: ICE: in as_a, at is-a.h:192)
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cgraph.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr65595.c19
4 files changed, 31 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1f6644d..5cee0a5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 0d2b826..96f5f40 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -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)
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9cbe0f9..03c4be4 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..0ab7161
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr65595.c
@@ -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); }
+