Skip to content

Commit 9abc6a0

Browse files
author
hubicka
committed
PR ipa/81360
* ipa-inline.c (can_inline_edge_p): Also check that caller is optimized * gcc.c-torture/compile/pr81360.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254937 138bc75d-0d04-0410-961f-82ee72b054a4
1 parent 9ead532 commit 9abc6a0

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

gcc/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2017-11-19 Jan Hubicka <[email protected]>
2+
3+
PR ipa/81360
4+
* ipa-inline.c (can_inline_edge_p): Also check that caller is optimized
5+
16
2017-11-19 Jan Hubicka <[email protected]>
27

38
PR ipa/83001

gcc/ipa-inline.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ can_inline_edge_p (struct cgraph_edge *e, bool report,
324324
e->inline_failed = CIF_BODY_NOT_AVAILABLE;
325325
inlinable = false;
326326
}
327-
if (!early && !opt_for_fn (callee->decl, optimize))
327+
if (!early && (!opt_for_fn (callee->decl, optimize)
328+
|| opt_for_fn (caller->decl, optimize)))
328329
{
329330
e->inline_failed = CIF_FUNCTION_NOT_OPTIMIZED;
330331
inlinable = false;

gcc/testsuite/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2017-11-19 Jan Hubicka <[email protected]>
2+
3+
PR ipa/81360
4+
* gcc.c-torture/compile/pr81360.c: New testcase.
5+
16
2017-11-19 Paul Thomas <[email protected]>
27

38
PR fortran/78990
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
typedef a;
2+
b(void *c, a d) {
3+
if (c)
4+
e(0, __PRETTY_FUNCTION__);
5+
}
6+
typedef f, g;
7+
__attribute__((optimize(0))) h() {
8+
g i;
9+
b(i, sizeof(f));
10+
}
11+

0 commit comments

Comments
 (0)