This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/36631] [4.3/4.4 Regression] attribute always_inline -> sorry, unimplemented: recursive inlining
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Sep 2008 14:27:00 -0000
- Subject: [Bug tree-optimization/36631] [4.3/4.4 Regression] attribute always_inline -> sorry, unimplemented: recursive inlining
- References: <bug-36631-16302@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from rguenth at gcc dot gnu dot org 2008-09-15 14:26 -------
This looks like a frontend bug to me. For B::g we record in the DECL_ARGUMENTS
(gdb) call debug_tree (p)
<parm_decl 0x7fae5daa2f30 c
type <record_type 0x7fae5d15da80 C addressable needs-constructing type_1
type_5 BLK
with DECL_ARG_TYPE (p) being
<record_type 0x7fae5d15da80 C addressable needs-constructing type_1 type_5 BLK
size <integer_cst 0x7fae5da9c7b0 type <integer_type 0x7fae5daaf0c0
bit_size_type> constant invariant 8>
but we pass it a reference in trigger():
(gdb) call debug_tree (*$1)
<addr_expr 0x7fae5d15f580
type <reference_type 0x7fae5d163540
type <record_type 0x7fae5d15da80 C addressable needs-constructing
type_1 type_5 BLK
like so:
(gdb) call debug_generic_expr (*expr_p)
g (&b, &TARGET_EXPR <D.2065, <<< Unknown tree: aggr_init_expr
5
__comp_ctor
D.2065
0B
(const struct C &) (const struct C *) (struct C *) c >>>
>)
which leads to (rightfully) CALL_CANNOT_INLINE_P set. The TYPE_ARG_TYPES
also require a record for the arguments.
So either the function call is wrong or DECL_ARG_TYPE and TYPE_ARG_TYPES
are not correct. The offending frontend code doing this is
convert_for_arg_passing which has
/* Pass classes with copy ctors by invisible reference. */
else if (TREE_ADDRESSABLE (type))
val = build1 (ADDR_EXPR, build_reference_type (type), val);
but it doesn't communicate this to the middle-end.
Jason, can you shed some light on when/if/why not C++ is setting
DECL_ARG_TYPE to what? Thanks.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
AssignedTo|rguenth at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36631