Re: [PATCH RFA] tree-inline: Fix VLA handling [PR95552]

2020-06-09 Thread Eric Botcazou
> Like this? Fine with me, thanks! -- Eric Botcazou

Re: [PATCH RFA] tree-inline: Fix VLA handling [PR95552]

2020-06-09 Thread Jason Merrill via Gcc-patches
On 6/9/20 8:41 AM, Eric Botcazou wrote: Yes, but the problem is that remap_decl isn't getting called. Right, I can get it to be called by adding a pushdecl to grokdeclarator... Attaching it to the BIND_EXPR doesn't help walk_tree_1 do the right thing with the DECL_EXPR. ... but, indeed, thi

Re: [PATCH RFA] tree-inline: Fix VLA handling [PR95552]

2020-06-09 Thread Eric Botcazou
> Yes, but the problem is that remap_decl isn't getting called. Right, I can get it to be called by adding a pushdecl to grokdeclarator... > Attaching it to the BIND_EXPR doesn't help walk_tree_1 do the right > thing with the DECL_EXPR. ... but, indeed, this still ICEs. So the key is that the D

Re: [PATCH RFA] tree-inline: Fix VLA handling [PR95552]

2020-06-08 Thread Jason Merrill via Gcc-patches
On 6/8/20 4:19 PM, Jason Merrill wrote: On 6/8/20 5:46 AM, Eric Botcazou wrote: The only case handled specially is TYPE_DECL; other DECL_EXPRs fall through to the default case, where we WALK_SUBTREE over all the operands of the expression, which for DECL_EXPR is the decl. It seems hard to beli

Re: [PATCH RFA] tree-inline: Fix VLA handling [PR95552]

2020-06-08 Thread Jason Merrill via Gcc-patches
On 6/8/20 5:46 AM, Eric Botcazou wrote: The only case handled specially is TYPE_DECL; other DECL_EXPRs fall through to the default case, where we WALK_SUBTREE over all the operands of the expression, which for DECL_EXPR is the decl. It seems hard to believe that the inliner relies on this to co

Re: [PATCH RFA] tree-inline: Fix VLA handling [PR95552]

2020-06-08 Thread Eric Botcazou
> The only case handled specially is TYPE_DECL; other DECL_EXPRs fall > through to the default case, where we WALK_SUBTREE over all the operands > of the expression, which for DECL_EXPR is the decl. It seems hard to believe that the inliner relies on this to copy DECLs though, see the calls to re

Re: [PATCH RFA] tree-inline: Fix VLA handling [PR95552]

2020-06-07 Thread Jason Merrill via Gcc-patches
On 6/6/20 4:56 AM, Eric Botcazou wrote: This patch fixes walk_tree_1 to call the function on the TYPE_DECL, as we do for other decls of a DECL_EXPR. Where is that done exactly? The only case handled by DECL_EXPR is TYPE_DECL. The only case handled specially is TYPE_DECL; other DECL_EXPRs fal

Re: [PATCH RFA] tree-inline: Fix VLA handling [PR95552]

2020-06-06 Thread Eric Botcazou
> This patch fixes walk_tree_1 to call the function on the TYPE_DECL, as we do > for other decls of a DECL_EXPR. Where is that done exactly? The only case handled by DECL_EXPR is TYPE_DECL. The correct thing to do is clearly implied by the first line in your patch. -- Eric Botcazou

Re: [PATCH RFA] tree-inline: Fix VLA handling [PR95552]

2020-06-05 Thread Richard Biener via Gcc-patches
On June 6, 2020 6:17:49 AM GMT+02:00, Jason Merrill via Gcc-patches wrote: >The problem in this testcase comes from cloning the constructor into >complete and base variants. When we clone the body the first time, >walk_tree_1 calls copy_tree_body_r on the type of the artificial >TYPE_DECL >we ma