From: Jan Hubicka Date: Fri, 27 Mar 2015 10:33:17 +0000 (+0100) Subject: re PR middle-end/65595 (Linux kernel build failure: ICE: in as_a, at is-a.h:192) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=88e7d85fba68f0f9f3d87f14899dbcb6018a2844;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1f6644d5863..5cee0a5c9c6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-26 Jan Hubicka + + 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 PR target/65495 diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 0d2b826a5e7..96f5f40b801 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 9cbe0f93570..03c4be4bc38 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-26 Jan Hubicka + + PR middle-end/65595 + * gcc.c-torture/compile/pr65595.c: New testcase. + 2015-03-27 Marek Polacek 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 00000000000..0ab716120c9 --- /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); } +