This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/11491] Problem with optimized inline caller of alloca()
- From: "pinskia at physics dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jul 2003 19:50:26 -0000
- Subject: [Bug middle-end/11491] Problem with optimized inline caller of alloca()
- References: <20030710170048.11491.tingjun.wen@idt.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11491
------- Additional Comments From pinskia at physics dot uc dot edu 2003-07-10 19:50 -------
The tree inline was in 3.2, the problem was there was no check for alloca until 3.3.
The tree inline (for c) was added by this patch:
2001-10-05 Alexandre Oliva
* Makefile.in (c-decl.o): Depend on tree-inline.h.
(c-lang.o): Likewise, as well as insn-config.h and integrate.h.
* c-decl.c: Include tree-inline.h.
(c_expand_body): Call optimize_inline_calls. Determine whether
a function is inlinable upfront, and only clear
DECL_SAVED_TREE, DECL_INITIAL and DECL_ARGUMENTS if it isn't.
* c-lang.c: Include tree-inline.h, insn-config.h and integrate.h.
(c_disregard_inline_limits): New function.
(inline_forbidden_p, c_cannot_inline_tree_fn): Likewise.
(c_post_options): Enable tree inlining if inlining is enabled.
Don't inline trees when instrumenting functions.
(c_init): Initialize lang_disregard_inline_limits and
lang_cannot_inline_tree_fn.
* tree-inline.c (initialize_inlined_parameters): Handle calls
with fewer arguments than declared parameters, and fewer
parameters than passed arguments. Don't assume value is a
DECL.
(declare_return_variable): Convert return value back to the
original type, if it was promoted.
(tree_inlinable_function_p): New function.
(inlinable_function_p): Don't look at DECL_INLINE if we're
inlining all functions. Make it work with a NULL id.
Re-check DECL_UNINLINABLE after language-specific checks.
* tree-inline.h (tree_inlinable_function_p): Declare it.
* integrate.c (save_for_inline): Don't bother to prepare argvec
when not inlining.
* cse.c (check_for_label_ref): Don't check deleted labels.
* Makefile.in (tree-inline.o): Depend on newly-included headers.
* tree-inline.c: Include headers needed for the functions moved in.
(struct inline_data, INSNS_PER_STMT): Moved from cp/optimize.c.
(remap_decl, remap_block, copy_scopy_stmt, copy_body_r): Likewise.
(copy_body, initialize_inlined_parameters): Likewise.
(declare_return_variable, inlinable_function_p): Likewise.
(expand_call_inline, expand_calls_inline): Likewise.
(optimize_inline_calls, clone_body): Likewise.
(walk_tree, walk_tree_without_duplicates): Moved from cp/tree.c.
(copy_tree_r, remap_save_expr): Likewise.