This is the mail archive of the
mailing list for the GCC project.
Re: Question regarding bug 70584
- From: Daniel Gutson <daniel dot gutson at tallertechnologies dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Andres Tiraboschi <andres dot tiraboschi at tallertechnologies dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, gcc Mailing List <gcc at gcc dot gnu dot org>
- Date: Fri, 20 May 2016 18:41:03 -0300
- Subject: Re: Question regarding bug 70584
- Authentication-results: sourceware.org; auth=none
- References: <CAJZwELm_pzAPaf_MDLNcaAMmDzAyrYv2UbhMAytqaLK=DssLbw at mail dot gmail dot com> <CAF5HaEUn79e9JAc6qvyWDXiLJTanJzeDZBx0s12mYh7+c=iQJQ at mail dot gmail dot com> <6f57deba-0678-67cc-3f53-10f7e16ba296 at redhat dot com>
On Fri, May 20, 2016 at 5:42 PM, Jeff Law <firstname.lastname@example.org> wrote:
> On 05/20/2016 01:18 PM, Daniel Gutson wrote:
>> (reposting in gcc@ and adding more information)
>> On Fri, May 20, 2016 at 3:43 PM, Andres Tiraboschi
>> <email@example.com> wrote:
>>> While analysing this bug we arrived to the following code at
>>> tree.c:145 (lvalue_kind):
>>> case VAR_DECL:
>>> if (TREE_READONLY (ref) && ! TREE_STATIC (ref)
>>> && DECL_LANG_SPECIFIC (ref)
>>> && DECL_IN_AGGR_P (ref))
>>> return clk_none;
>>> That condition fails so a fall-through to the next case labels causes
>>> to return clk_ordinary, whereas this is about a constexpr value
>>> (rather than a reference).
>>> As an experiment, we forced the condition above to return clk_none and
>>> the bug is not reproduced.
>>> We are suspecting either that the condition is too restrictive or a
>>> fall-through is not intended. Why is the condition requiring
>> Just to provide more information: DECL_LANG_SPECIFIC is NULL and
>> DECL_IN_AGGR_P is false.
>> Can somebody provide the rationale of the condition?
> I'm not really an expert in this code, but it looks like we're returning
> clk_none for a small subset of nodes that aren't really lvalues. Examples
> would be certain read-only objects which can't be lvalues.
> Other VAR_DECLs would be lvalues and should probably return clk_ordinary.
> At least that how it appears to me.
Thanks, Jason and us already solved. I think he will commit the patch soon.
Daniel F. Gutson
San Lorenzo 47, 3rd Floor, Office 5
Phone: +54 351 4217888 / +54 351 4218211