This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/65284] [5 Regression] ICE (segfault) on arm-linux-gnueabihf
- From: "aldyh at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 Mar 2015 02:46:03 +0000
- Subject: [Bug c++/65284] [5 Regression] ICE (segfault) on arm-linux-gnueabihf
- Auto-submitted: auto-generated
- References: <bug-65284-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65284
--- Comment #6 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
For the construction of the lambda in the simplified testcase I have just
uploaded:
MaybeInt().xmap([abc](int childId)
{
return ParsedSchema(bark, childId + 666);
});
We initially generate the following tree:
ParsedSchema::findNested()::<lambda(int)> (const struct __lambda0 * const
__closure, int childId)
{
const int abc [value-expr: __closure->__abc];
<<cleanup_point return D.2331 = <<< Unknown tree: aggr_init_expr
6
__comp_ctor
*NON_LVALUE_EXPR <this>
NON_LVALUE_EXPR <this>
*NON_LVALUE_EXPR <this> = bark;, <<< Unknown tree: empty_class_expr >>>;
childId + 666 >>>>>;
}
Whose AGGR_INIT_EXPR will be gimplified into:
ParsedSchema::findNested()::<lambda(int)> (const struct __lambda0 * const
__closure, int childId)
{
const int abc [value-expr: __closure->__abc];
<<cleanup_point return D.2331 = ParsedSchema::ParsedSchema (&*NON_LVALUE_EXPR
<this>, *NON_LVALUE_EXPR <this> = bark;, <<< Unknown tree: empty_class_expr
>>>;, childId + 666)>>;
}
Notice the non-existent return value from ParsedSchema::ParsedSchema is being
read from, and constructors do not return anything. I suppose D.2331 should be
set from NON_LVALUE_EXPR<this>, although even the assignment into
*NON_LVALUE_EXPR looks odd. Isn't a NON_LVALUE_EXPR by definition not
assignable?
Before the patch that broke this, we had:
<<cleanup_point return <retval> = TARGET_EXPR <D.2133, <<< Unknown tree:
aggr_init_expr
6
__comp_ctor
D.2133
(struct ParsedSchema *) 0
TARGET_EXPR <D.2123, bark>;, <<< Unknown tree: empty_class_expr >>>;
childId + 666 >>>>;, D.2133>>;
Notice the TARGET_EXPR, which then does the right thing when gimplified.