diff options
| author | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-29 23:32:44 +0000 |
|---|---|---|
| committer | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-29 23:32:44 +0000 |
| commit | 63c5fe463f1fef95bbe540c8e8ce64971b64d8bf (patch) | |
| tree | 998d8bdfe8240b5ebae5010c1f1a3132943928c6 | |
| parent | 5f1e93312ff619f3141a6f04f47792a2a9c90931 (diff) | |
| download | ppe42-gcc-63c5fe463f1fef95bbe540c8e8ce64971b64d8bf.tar.gz ppe42-gcc-63c5fe463f1fef95bbe540c8e8ce64971b64d8bf.zip | |
* tree-inline.c (inlinable_function_p): Don't support inlining
functions using varargs.
Index: testsuite/ChangeLog
* gcc.c-torture/compile/inline-1.c: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66269 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 3 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/inline-1.c | 21 | ||||
| -rw-r--r-- | gcc/tree-inline.c | 7 |
4 files changed, 35 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 70b69cc2fd3..75d3dec41be 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -23,6 +23,9 @@ 2003-04-29 Geoffrey Keating <geoffk@apple.com> + * tree-inline.c (inlinable_function_p): Don't support inlining + functions using varargs. + * doc/invoke.texi (Overall Options): Mention -x objective-c-header. * dwarf2out.c (output_call_frame_info): No need to output EH diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4a0d42cbea2..14607687a20 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-04-29 Geoffrey Keating <geoffk@apple.com> + + * gcc.c-torture/compile/inline-1.c: New file. + 2003-04-29 Mark Mitchell <mark@codesourcery.com> PR c++/10551 diff --git a/gcc/testsuite/gcc.c-torture/compile/inline-1.c b/gcc/testsuite/gcc.c-torture/compile/inline-1.c new file mode 100644 index 00000000000..23af7cb2bfc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/inline-1.c @@ -0,0 +1,21 @@ +typedef __builtin_va_list va_list; + +extern void foo (va_list); + +static void +build_message_string (const char *msg, ...) +{ + va_list ap; + + __builtin_va_start (ap, msg); + foo (ap); + __builtin_va_end (ap); +} + +void +file_name_as_prefix (f) + const char *f; +{ + build_message_string ("%s: ", f); +} + diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 3a8adc51e2e..d1acba3a5f0 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1008,6 +1008,13 @@ inlinable_function_p (fn, id, nolimit) else if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL && find_alloca_call (DECL_SAVED_TREE (fn))) ; + /* Can't inline functions which use varargs. It's not theoretically + impossible, we just don't do it yet; at least one problem is that + expand_builtin_next_arg needs to handle the situation. */ + else if (TYPE_ARG_TYPES (TREE_TYPE (fn)) != 0 + && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (fn)))) + != void_type_node)) + ; /* All is well. We can inline this function. Traditionally, GCC has refused to inline functions using alloca, or functions whose values are returned in a PARALLEL, and a few other such obscure |

