diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-05 20:10:13 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-05 20:10:13 +0000 |
commit | 650616602d3b5a15939ce4d74fb101fbabdcebae (patch) | |
tree | d987044d0ed96299195ed52d4533e2376afd67de /gcc/tree-inline.c | |
parent | 99617355e9cba5fc47f5283caefbe0f22ef8c578 (diff) | |
download | gcc-650616602d3b5a15939ce4d74fb101fbabdcebae.tar.gz |
PR tree-optimization/20076
* tree-inline.c (inline_forbidden_p_1): Prevent inlining functions
that call __builtin_return or __builtin_apply_args.
* gcc.dg/builtin-apply4.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97653 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 59a2d7237c9..efa6e310e98 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1017,6 +1017,17 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED, "it uses non-local goto"); return node; + case BUILT_IN_RETURN: + case BUILT_IN_APPLY_ARGS: + /* If a __builtin_apply_args caller would be inlined, + it would be saving arguments of the function it has + been inlined into. Similarly __builtin_return would + return from the function the inline has been inlined into. */ + inline_forbidden_reason + = N_("%Jfunction %qF can never be inlined because " + "it uses __builtin_return or __builtin_apply_args"); + return node; + default: break; } |