On Tue, Mar 29, 2016 at 8:42 PM, Jason Merrill <ja...@redhat.com> wrote:
> On 03/29/2016 06:37 AM, Jan Hubicka wrote:
>>>
>>> On Mon, Mar 28, 2016 at 11:26 PM, Jason Merrill <ja...@redhat.com> wrote:
>>>>
>>>> The constexpr evaluation code uses the inlining code to remap the
>>>> constexpr
>>>> function body for evaluation so that recursion works properly.  In this
>>>> testcase __func__ is declared as a static local variable, so rather than
>>>> remap it, remap_decls tries to add it to the local_decls list for the
>>>> function we're inlining into.  But there is no such function in this
>>>> case,
>>>> so we crash.
>>>>
>>>> Avoid the add_local_decl call when cfun is null avoids the ICE (thanks
>>>> Jakub), but results in an undefined symbol.  Calling
>>>> varpool_node::finalize_decl instead allows cgraph to handle the
>>>> reference
>>>> from 'c' properly.
>>>>
>>>> OK if testing passes?
>>>
>>>
>>> So ce will never be instantiated?
>
>
> Right, because no calls to it survive constexpr evaluation.  And the front
> end avoids finalizing it in make_rtl_for_nonlocal_decl...which is another
> place I could fix this.  Thus.
>
> Tested x86_64-pc-linux-gnu, applying to trunk.

Much better!

Thanks,
Richard.

> Jason
>

Reply via email to