diff options
author | tmsriram <tmsriram@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-18 22:45:03 +0000 |
---|---|---|
committer | tmsriram <tmsriram@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-18 22:45:03 +0000 |
commit | 3bc4161a6a4610c91897d637c64dfd50003455ba (patch) | |
tree | 36b462d3fe220a71b684a5b371e52f55cfc14584 /gcc/ipa-inline.c | |
parent | 4b2b9c300bb7a5b7dd80f43dfcda6d3337a98df8 (diff) | |
download | gcc-3bc4161a6a4610c91897d637c64dfd50003455ba.tar.gz |
Emit errors when always_inline functions cannot be inlined in -O0 mode.
* tree-inline.c (expand_call_inline): Allow the error to be flagged
in early inline pass.
* ipa-inline.c (inline_always_inline_functions): Pretend always_inline
functions are inlined during failures to flag an error.
* gcc.target/i386/inline_error.c: New test.
* gcc.c-torture/compile/pr44043.c: Fix test to expect an error.
* gcc.c-torture/compile/pr43791.c: Fix test to expect an error.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200179 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 5d50bb43604..d1f0089eb83 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1911,7 +1911,15 @@ inline_always_inline_functions (struct cgraph_node *node) } if (!can_early_inline_edge_p (e)) - continue; + { + /* Set inlined to true if the callee is marked "always_inline" but + is not inlinable. This will allow flagging an error later in + expand_call_inline in tree-inline.c. */ + if (lookup_attribute ("always_inline", + DECL_ATTRIBUTES (callee->symbol.decl)) != NULL) + inlined = true; + continue; + } if (dump_file) fprintf (dump_file, " Inlining %s into %s (always_inline).\n", |